Applet with JNI

U

Uli Kunkel

I'm developing an applet that calls a wrapper c++ dll using JNI.
The wrapper dll itself uses some other dlls.
Applet---Wrapper DLL----Other DLLs

This "Other DLLs" have to be in my java_home/bin directory to be called
correctly.
What I want is to create a jar that will contain them all.
I'm currently loading the Wrapper Dll whit System.load(path_to_dll).

Can I include this dlls in my project and have them in one jar file or
I'll have to put them in the system path instead?

Thanks in advance for any suggestions.
 
A

Andrew Thompson

On Nov 20, 9:06 pm, Sabine Dinis Blochberger <[email protected]>
wrote:
....
When using JWS, each native library gets it's own jar.

There is no rule to that effect. Since JWS downloads
natives eagerly, it makes no point to split them up
beyond jar's for each platform.
 
A

Arne Vajhøj

Uli said:
I'm developing an applet that calls a wrapper c++ dll using JNI.
The wrapper dll itself uses some other dlls.
Applet---Wrapper DLL----Other DLLs

This "Other DLLs" have to be in my java_home/bin directory to be called
correctly.
What I want is to create a jar that will contain them all.
I'm currently loading the Wrapper Dll whit System.load(path_to_dll).

Can I include this dlls in my project and have them in one jar file or
I'll have to put them in the system path instead?

Applet: no.

JWS: see the other replies.

Arne
 
A

Andrew Thompson

Well, yes, that's right. In my case, we have to sign our application, so
that's in my brain.

When you need to sign it, then you have to jar them in order to be able
to sign them.

True, but since that is not directly related to
what I was mentioning, I think we are talking at
'cross-purposes'.

I simply meant that if you had a project with 4
Win DLLs, 3 *nix style .so's, and no natives for Mac,
you might end up with 3 Jar files in total.

The 'pure java' component that all platforms get
in one jar, and one jar of 'natives' for each of
Win and *nix.

Of course, you could even reduce that to just two
Jar's - one containing both flavors of native, but
that means an extra (redundant) download hit for
each platform.
 
U

Uli Kunkel

Uli said:
I'm developing an applet that calls a wrapper c++ dll using JNI.
The wrapper dll itself uses some other dlls.
Applet---Wrapper DLL----Other DLLs

This "Other DLLs" have to be in my java_home/bin directory to be called
correctly.
What I want is to create a jar that will contain them all.
I'm currently loading the Wrapper Dll whit System.load(path_to_dll).

Can I include this dlls in my project and have them in one jar file or
I'll have to put them in the system path instead?

Thanks in advance for any suggestions.

Thank you all for the replays.
For the time I tried just to copy the native dlls to the client.
So I copied the WrapperDLL and OtherDLLs to "C:\AppletDLLs".

The wrapper dll loads fine, but he cannot call Other DLLs.
Where to put these "Other dlls"?


p.s.During development I had to put these Other DLLs in
java_home/jre/bin directory to work.
If I don't use java then they are in the same directory as the exe or
dll file..
 
R

Roedy Green

I'm developing an applet that calls a wrapper c++ dll using JNI.
The wrapper dll itself uses some other dlls.
Applet---Wrapper DLL----Other DLLs

This "Other DLLs" have to be in my java_home/bin directory to be called
correctly.
What I want is to create a jar that will contain them all.
I'm currently loading the Wrapper Dll whit System.load(path_to_dll).

Can I include this dlls in my project and have them in one jar file or
I'll have to put them in the system path instead?

Thanks in advance for any suggestions.

This is a nightmare. Use Java Web Start instead. It will deal with
installing the DLL files somewhere on the library path for you and
later uninstalling them.

There is a feature of JWS for launching Applets. It may be suitable
combo for both approaches.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Your old road is
Rapidly agin'.
Please get out of the new one
If you can't lend your hand
For the times they are a-changin'.
 
U

Uli Kunkel

Roedy said:
This is a nightmare. Use Java Web Start instead. It will deal with
installing the DLL files somewhere on the library path for you and
later uninstalling them.

There is a feature of JWS for launching Applets. It may be suitable
combo for both approaches.

It works now.
These Other DLLs had to be in system folder.
I think I should put all the dlls in the system folder and preinstall
them because there are going to be just a couple of client machines.
 
U

Uli Kunkel

Sabine said:
What's this "system folder"? Like \Windows\system32 ? If it is then
*that* is a nightmare.

It reminds me of computer games (or applications in many cases) that
were written using MS VC++ - then they forget that not every user has
that IDE, and don't package the dlls with their application, making it
impossible to use. Thank the internet, you can get those frakking dlls
anyway.

I prefer keeping libraries with each application. These days, disk space
is no problem. And you avoid dll hell.

Yes it is \WINDOWS\system32.
I also tried to put the path to the dlls to the path environment
variable but that didn't work.
System folder was the only thing that worked.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top