Skip to main content

using jni with new plugin

8 replies [Last post]
tkram01
Offline
Joined: 2005-12-14

Are there any feature additions in the new plugin for using jni? For instance, is there a way to deliver the dlls like there is in java webstart? We are trying to use a third party jni product in an applet (and so using the applet jnlp launcher won't work for us since we don't control the load library calls).

Trevor

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tkram01
Offline
Joined: 2005-12-14

Thanks. I have been able to insert the applet tag pointing to a remote jnlp for one of the examples into a local webpage and it works great. However, whenever I change the codebase to a local server I get the following error

Applet Status: exception: null.
exception: null.
java.io.FileNotFoundException: JNLP not available: scenario-applet.jnlp
at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.io.FileNotFoundException: JNLP not available: scenario-applet.jnlp

even though the jnlp is on the server under the codebase. Here is the html I am using.


codebase="http://coffee.vpharm.com/test/"
code="demo.applet.DemoApplet" archive="BackwardCompatibility.jar">


and here is a listing of the contents of /test

BackwardCompatibility.jar scenario-applet.jnlp
Scenario-Demos.jar index.html

Thanks,

Trevor

tkram01
Offline
Joined: 2005-12-14

I resolved this by adding the information section to my jnlp file. The examples in the documentation don't indicate that this is required.

kbr
Offline
Joined: 2003-06-16

I'll update the documentation to indicate this. I've run into this issue myself.

demonduck
Offline
Joined: 2008-03-14

> Yes. In a forthcoming build of the new Java Plug-In
> we aim to introduce the ability to launch applets
> directly from JNLP files. This means that you will be
> able to use Java Web Start extension JNLPs unmodified
> in your applets. I can't promise when or whether this
> will show up in 6u10 but we are tentatively aiming
> the initial integration at build 13.

I don't understand what you said.

Lets say I have an applet that uses a particular dll (for Windows). Can I put the dll in the applet jar file and then call the native language functions in the dll from the applet?

Is the dll put into a special place to be executed by the client machine?

Does the dll stay resident on the client machine after the applet is destroyed? Would other applets be able to call out to the dll?

Is the dll stored in the Java cache and is the applet allowed to control whether or not the dll is cached like I can with other resources?

Please explain this so dumb ducks can understand ...

kbr
Offline
Joined: 2003-06-16

The first draft of the documentation for JNLP support in the new plug-in is now available:

https://jdk6.dev.java.net/plugin2/jnlp/

There are some examples which should help you get started.

Now deployment of JNI libraries is identical to how it's done with Java Web Start.

demonduck
Offline
Joined: 2008-03-14

> The first draft of the documentation for JNLP support
> in the new plug-in is now available:
>
> https://jdk6.dev.java.net/plugin2/jnlp/
>
> There are some examples which should help you get
> started.
>
> Now deployment of JNI libraries is identical to how
> it's done with Java Web Start.

The first question I have is:

Is there an editing tool or an application that helps one write a JNLP file? A complicated JNLP file (which I have never written or looked at the specification for) would be a nightmare to debug.

Where do I look for a JNLP editor?

DD

kbr
Offline
Joined: 2003-06-16

Yes. In a forthcoming build of the new Java Plug-In we aim to introduce the ability to launch applets directly from JNLP files. This means that you will be able to use Java Web Start extension JNLPs unmodified in your applets. I can't promise when or whether this will show up in 6u10 but we are tentatively aiming the initial integration at build 13.

tkram01
Offline
Joined: 2005-12-14

any updates on this?