I am using Java to develop an application and I have a library that I should be able to use . The library has a jar file and a DLL file. At the moment I have put the DLL file in my system folder and connected to the jar with the IDE. My question is, I want to package everything in an executable jar in which the user can turn on (maybe using WebStart).
How can this jar file be generated without copying Dell into user's system folder? Is there any way that I can put everything in a collection?
You can package the . DLL
is inserted in .jar
, but the physical .dll
should be unpacked from there, because it handles Windows .dll
. There is no way to load .dll
directly from within .jar
.
There is a proper implementation involved, though, it is some error prone: if the program did not write the permissions to remove .dll
You are in a strange situation; You can not load .dll
because you do not have permission to write it first.
A more robust solution is to use any kind of installer to install the full application
/ whatEver / myApp / (the working directory of the app) / directory / /library.dll (JNI Library.) In a directory hierarchy in the form of My Apps / MyFaseer (main app) / WhatEver / myApp / lib
Then relative to the working directory Using a path, DLL can load,
System.loadLibrary ("lib / library.dll");
To be more robust, you would want to ensure that before you try to load the library, you are running a JVM with the appropriate bit. The slightly advertised fact is that 64-bit VM can not load 32-bit libraries, nor vice versa. See the question.
Comments
Post a Comment