Thanks for the responses.
We are developing a tool based on the NetBeans platform. We are looking at using a 64 bit JRE to overcome heap limitations as well as virtual-memory address space limitations. We’ve experienced huge improvements in I/O with MappedByteBuffers but with 2^(32-1) of virtual address space we are very limited (especially since we’re also using a lot of physical memory and heavy use of heap reduces virtual address space left for mapped file i/o). So yeah, 32 bits is quite limiting for us…
I appreciate the ease that System.loadLibrary(…) offers with regards to transparent cross-platform native library loading, but it really doesn’t cover 32 vs. 64 at all ouch.
I’d already looked at the URL you’ve posted and I’ve come to the conclusion that the current incarnation of netbeans can’t handle this use case and can’t without changes the the module classloader (org.netbeans.StandardModule$OneModuleClassLoader) in bootstrap.jar.
The classloader implements findLibrary(…) as such:
/** look for JNI libraries also in modules/bin/ */
protected String findLibrary(String libname) {
String mapped = System.mapLibraryName(libname);
File lib = new File(new File(jar.getParentFile(), "lib"), mapped); // NOI18N
if (lib.isFile()) {
return lib.getAbsolutePath();
} else {
return null;
}
}
Note that the comment is wrong and the class loader actually looks in modules/lib.
I think the only way we’re going to get this to work is if we can get the NetBeans crew to search in platform specific paths. i.e. for windows search in modules/lib/windows-i586 or modules/lib/windows-amd64 dependent on architecture. That would allow us to create module wrappers and support both 32 and 64 bit native libraries if they are forced to share the same name.
This issue affects any Java API extension library utilizing System.loadLibrary(…) sematics (Java3D, JAI, JAI ImageIO, etc…) so hopefully we can convince the NetBeans crew to modify the module class loader to parse paths dependent on platform. Without this change I have to create mulitple build targets dependent on platform… kind of goes against the java “build once, run everywhere” mantra…
I’ve posted to dev@openide.netbeans.org about this. If you 2 could chime in so that we can get critical mass it would be swell…
Thanks much,
Tom