JNA comes as a dependency in a project of ours, which is bundled and packaged with a JVM (using jlink and jpackage), so the code is enclosed as a module.
We are running into the following problem now:
The code needs to load the native dispatch library from the classpath using ithe method 'loadNativeDispatchLibraryFromClasspath' of 'Native.java'.o
Inside this method the library is loaded using a 'URLClassLoader'
To make the this work in packaged code (i.E. on OSX), our module needs to make this code avaliable from 'outside' the module via this line in the 'module-info.java':
opens com.sun.jna.darwin;
This works fine for OSX, but fails for other plattforms, if they contain a dash '-' in the package name of the native dispatch library.
A line like this results in an compile error, cause the dash is not allowed in package names:
opens com.sun.jna.win32-x86;
Question now is: Are there plans to move the code of JNA towards modularization? Then maybe this issue could be solved using the 'getResourceAsStream' method of the 'Module' class.
Or another (more hacky) way would be to rename the packages, so they do not contain any more dashes.
Any feedback regarding this issue yould be great. TIA!
JNA comes as a dependency in a project of ours, which is bundled and packaged with a JVM (using jlink and jpackage), so the code is enclosed as a module.
We are running into the following problem now:
The code needs to load the native dispatch library from the classpath using ithe method 'loadNativeDispatchLibraryFromClasspath' of 'Native.java'.o
Inside this method the library is loaded using a 'URLClassLoader'
To make the this work in packaged code (i.E. on OSX), our module needs to make this code avaliable from 'outside' the module via this line in the 'module-info.java':
opens com.sun.jna.darwin;This works fine for OSX, but fails for other plattforms, if they contain a dash '-' in the package name of the native dispatch library.
A line like this results in an compile error, cause the dash is not allowed in package names:
opens com.sun.jna.win32-x86;Question now is: Are there plans to move the code of JNA towards modularization? Then maybe this issue could be solved using the 'getResourceAsStream' method of the 'Module' class.
Or another (more hacky) way would be to rename the packages, so they do not contain any more dashes.
Any feedback regarding this issue yould be great. TIA!