Your code is really MUCH! cleaner... My code was written during my bus trip to work.
I also noticed you removed the dependency on commons-logging. Cool, makes my program a little smaller

Thank you very much for your great support for your library
// Hook to get the correct path to the dll when we use the JAR
URL dll = getClass().getResource("/JIntellitype.dll");
JIntellitype.setLibraryLocation(dll.toString());
dll.getFile()
Dark$hadow wrote:I've tried but it still doesn't works
I don't need the dll to be in the JAR. Be in the same folder would be perfect.
Dark$hadow wrote:Thanks for your help
I've tried the first method you propose but I got the same error.
But by hardcoding the fullpath, it succeed !!
So my problem is now to know how to refer to the dll from my main class (which is in the JAR).![]()
Any idea?
File file = new File(".");
System.Out.PrintLn(file.getAbsolutePath());
File file= new File(MyClass.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
System.Out.PrintLn(file.getAbsolutePath());
Dark$hadow wrote:Better news!!!
I get now a full path: "C:\Users\Pierre\Desktop\Client\Click2Dial-Computer\build\install\lib\Clic2Dial.jar"
Does the same function without the file name exists?
Many thanks for your help !!!
File file = null;
try {
file = new File(MyClass.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
} catch (URISyntaxException e1) {
e1.printStackTrace();
}
System.out.println(file.getParent().getAbsolutePath());
File file = null;
try {
file = new File(MyClass.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
} catch (URISyntaxException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
JIntellitype.setLibraryLocation(file.getParentFile().getAbsolutePath() + "\\JIntellitype.dll");
Users browsing this forum: No registered users and 1 guest