Where to put the dlls when using JNI

B

bearice

Hello all,
I'm tring to pack a dll into a jar file,but I can't load it. What can
i do for it?
 
S

Sanjay

Hello all,
I'm tring to pack a dll into a jar file,but I can't load it. What can
i do for it?

Not sure about windows, but may be you can deduce something from this.

While developing jni program on linux, i used to put by .so files
(shared library objects, which are like dynamic linked libraries) in the
LD_LIBRARY_PATH.

HTH

Sanjay
 
C

Chris Uppal

I'm tring to pack a dll into a jar file,but I can't load it. What can
i do for it?

DLLs are loaded by the OS (well, actually I don't think that's technically
true, but it's close enough), so the DLL has to be somewhere where the OS can
read it. JAR files don't count. You'll have to extract the DLL from the JAR
before using it.

(Or else use some really /serious/ low-level magic to extract the DLL data from
the JAR and map it directly into your Windows process's address space, do any
fixups, etc... ;-)

-- chris
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Chris said:
DLLs are loaded by the OS (well, actually I don't think that's technically
true, but it's close enough), so the DLL has to be somewhere where the OS can
read it.
Yep.

JAR files don't count. You'll have to extract the DLL from the JAR
before using it.

(Or else use some really /serious/ low-level magic to extract the DLL data from
the JAR and map it directly into your Windows process's address space, do any
fixups, etc... ;-)

Extracting the dll files from the jar file to disk from the running Java
code before loading them the standard way would be less magic.

Arne
 

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,764
Messages
2,569,567
Members
45,042
Latest member
icassiem

Latest Threads

Top