Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if a dll library is already loaded? (Java)

In a Java program i am writing i make a jni call to a dll and load the library on startup as follows

static
{
   System.loadLibrary("LdapAuthenticator2");
}

I then implemented another class that loads the same library and am getting an error saying that the library is already loaded, is there any way to check if the library is already running?

Thanks,
-Pete

like image 745
Petey B Avatar asked Jul 16 '09 18:07

Petey B


1 Answers

Check my answer to this question

How do I get a list of JNI libraries which are loaded?

The solution works, unfortunately the poster of the question seems to have problems with a non SUN compatible JVM or a too restrictive SecurityManager.

Link to the sample POC source code.

List loaded JNI libraries java sourcecode

like image 99
jitter Avatar answered Oct 04 '22 18:10

jitter