3

I am trying to deploy a project remotely using Java web start. Here it is working for a single jar file. Can anyone tell me how to deploy this for multiple jar files and as I am using SQLite DB which uses sqlite-jni.dll for its execution on windows? I need to include this file to in the JNLP.

Any kind of help will be appreciated.

Thanks in advance.

2 Answers 2

3

Put the native in the root of a signed Jar file and add it to a nativelib element in the JNLP. Since it is a DLL, make sure you add it to a Windows specific resources section.

Do you have natives for Mac. and *nix?


E.G.

<?xml version='1.0' encoding='UTF-8' ?>
<jnlp spec='1.0' codebase='http://our.com/lib/' href='our.jnlp'>
    <information>
        <title>Our App.</title>
        <vendor>our.com</vendor>
    </information>
    <security>
        <all-permissions />
    </security>
    <resources>
        <j2se version='1.5+' />
        <jar href='our.jar' main='true' />
        <jar href='sqlite.jar' />
    </resources>
    <!-- Supply the DLL only to windows -->
    <resources os='Windows' >
        <nativelib href='sqlite-jni-windows.jar' />
    </resources>
    <application-desc main-class='com.our.Main' />
</jnlp>

In this example, all resources should be located in http://our.com/lib/.

The native (in this case a DLL) should always be in the root of the Jar file.


I also offer JaNeLA which checks the validaty of JNLP files & performs sanity checks on many other aspects of JWS based launches.

Sign up to request clarification or add additional context in comments.

1 Comment

can you give me a sample as how to write jnlp for multiple jars and a .dll file...... and what about file locations... how we need to specify that for individual jars....Thanks in advance
0

In our case, we specify all the files needed (jar and zip wise) in our jnlp file. We have used .dll's but they were packaged with a program that was already installed on the system. We interacted with this program via ours. All we needed was to make sure the path to the .dll's was specified in the Windows path variable.

In terms of packaging, we packaged all our jars into a .war file and then put that .war into an .ear file (not necessary, but we did) and deployed that to our application server. When we updated the jar versions in our war, we also updated the jar version numbers in our .jnlp file (as well as in some version.xml file we use) and redeploy it all. Then when the client's fire up, they check against the new .jnlp file and download the right jars.

Is that helpful? Did I understand your question correctly?

3 Comments

"(jar and zip wise)" The Java plug-in will not check Zip files for digital signatures, so they cannot be included in a JNLP that requests all-permissions - which is necessary for natives. It might work if the Zip was in a sand-boxed extension, but I would not rely on it. It is best to stick to all Jar files in the jar & nativelib elements of the JNLP file.
u understood my question partly... but exactly i wanted to know how can we write jnlp for multiple jars and a dll file...
Do you have to deploy the dll with your app, or is it more likely the dll will already be on the system? Cause if that is the case, you can add it to your Windows Path variable. That is what we do for some of the dll's we need to work with.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.