Skip to main content

How do you properly set java.library.path for a native DLL?

4 replies [Last post]
Anonymous

How do you get Glassfish v3 Prelude to properly find native DLLs?

I've tried setting -Djava.library.path under the Application Server/JVM
Settings/JVM Options but the JVM still can't seem to find my DLL.

I'm trying to use the NTLMAUTH.DLL from jTDS.

thanks,
vic
--
View this message in context: http://www.nabble.com/How-do-you-properly-set-java.library.path-for-a-na...
Sent from the java.net - glassfish users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
victorng

Hmm.. my java.library.path line in jvm.log is truncated at exactly 2000
characters.

Well - it's len("java.library.path=") + 2000 characters.

Is that just a bug/limitation in the logger ?

vic

glassfish-2 wrote:
>
> (1)
> The JVM on Windows automatically sets the System Property,
> java.library.path, to the contents of your Windows environmental variable,
> "Path".
>
> All you need to do is make sure the dll is in your OS Path!
>
> --------------------
> (2)
> You can set the java.library.path yourself via a jvm-option but I don't
> recommend it. You lose the JVM help as in (1)
>
> -------------
> (3)
> On UNIX you have to do the work partially. I.e. you have to set the
> LD_LIBRARY_PATH
> environmental variable. The JVM will then set java.library.path to that
> variable's contents by default.
> [Message sent by forum member 'bnevins' (bnevins)]
>
> http://forums.java.net/jive/thread.jspa?messageID=355828
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>
>

--
View this message in context: http://www.nabble.com/How-do-you-properly-set-java.library.path-for-a-na...
Sent from the java.net - glassfish users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

bnevins
Offline
Joined: 2005-03-28
Points: 0

(1)
The JVM on Windows automatically sets the System Property, java.library.path, to the contents of your Windows environmental variable, "Path".

All you need to do is make sure the dll is in your OS Path!

--------------------
(2)
You can set the java.library.path yourself via a jvm-option but I don't recommend it. You lose the JVM help as in (1)

-------------
(3)
On UNIX you have to do the work partially. I.e. you have to set the
LD_LIBRARY_PATH
environmental variable. The JVM will then set java.library.path to that variable's contents by default.

victorng

I'm not sure if it's a bug in the logger or a limitation in Windows, but my
java.library.path looked like it was truncated when I was looking in
jvm.log. It looked like it was truncated ~2000 characters (not 2048 - I
think it was 2022).

vic

glassfish-2 wrote:
>
> (1)
> The JVM on Windows automatically sets the System Property,
> java.library.path, to the contents of your Windows environmental variable,
> "Path".
>
> All you need to do is make sure the dll is in your OS Path!
>
> --------------------
> (2)
> You can set the java.library.path yourself via a jvm-option but I don't
> recommend it. You lose the JVM help as in (1)
>
> -------------
> (3)
> On UNIX you have to do the work partially. I.e. you have to set the
> LD_LIBRARY_PATH
> environmental variable. The JVM will then set java.library.path to that
> variable's contents by default.
> [Message sent by forum member 'bnevins' (bnevins)]
>
> http://forums.java.net/jive/thread.jspa?messageID=355828
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>
>

--
View this message in context: http://www.nabble.com/How-do-you-properly-set-java.library.path-for-a-na...
Sent from the java.net - glassfish users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

victorng

Meh. I gave up. Since this is a server box, and I can't have different
versions of the same DLL installed within a JVM, I just ended up dropping
the DLL into c:\winnt

vic

victorng wrote:
>
> How do you get Glassfish v3 Prelude to properly find native DLLs?
>
> I've tried setting -Djava.library.path under the Application Server/JVM
> Settings/JVM Options but the JVM still can't seem to find my DLL.
>
> I'm trying to use the NTLMAUTH.DLL from jTDS.
>
> thanks,
> vic
>

--
View this message in context: http://www.nabble.com/How-do-you-properly-set-java.library.path-for-a-na...
Sent from the java.net - glassfish users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net