Hi Oliver,

Am Sonntag, den 04.03.2018, 17:46 +0100 schrieb Oliver Rettig:
> integration of native libs in the netbeans platform works fine for
> windows, linux, 32bit, 64bit 
> etc. as described in 
> 
> http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#jni
> 
> 
> I want to propose some simple lines of code to add in this method
> which additional search in 
> the the folder
> 
> modules/lib/<arch>/windows for the native libs
> 
> if the value of the environment variable os.name starts with
> "windows" but the libs are not 
> found in the folder modules/lib/<arch>/<os.name>
> 
> Does it make sense for you? Any better ideas to solve the problem?
> 

JNA follows a similar pattern and normalizes all windows versions to
win32. However for netbeans there is a simpler solution (from the
docs):

        The System.loadLibrary call originating from the module code will
        try to locate the library file in the following order of
        directories:

        modules/lib/
        modules/lib/<arch>/
        modules/lib/<arch>/<os>/


So if you place your .dll in the modules/lib/amd64 directory, it should
be loaded on all 64 bit JVMs on windows.

As I'm not aware of any platform apart from windows, that uses the .dll
suffix, this should work for you.

Maybe this helps already?

Greetings

Matthias

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@netbeans.incubator.apache.org
For additional commands, e-mail: dev-h...@netbeans.incubator.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to