Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

.dll files and global variables

843829Jul 27 2004 — edited Jan 18 2007
I have a .dll containing my native JNI implementations. It get loaded into my java app using System.loadLibrary(), and the first thing the java app does is call a native initGlobalObject() method. This does some initialization on a global object in the dll code. After that, other native methods assume this object has been constructed and reference it within their own implementation.

Now let's say I start up another instance of my Java app. When it loads the .dll, will it create its own instance of the global variable (the behaviour I want), or will it share the instance that has already been created and initialized by the first Java app?

Thanks for any info,
John
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 15 2007
Added on Jul 27 2004
7 comments
275 views