I am trying to gather system information using the SIGAR API. After including sigar.jar in my library, Netbeans gave the error that sigar-amd64-winnt.dll
was not found. After adding that file to the library, it worked perfectly.
Now i needed to create an executable jar so I used NetBeans to Build my project. Netbeans automatically deleted the .dll file and after i manually copied it back to the dist folder, my program worked. I am now trying to create an exe file using Launch4j. When i run it, a java exception is thrown, probably because Launch4j deleted the .dll file.
How can i make sure Launch4j includes it in the exe file?
I browsed through numerous answers on SO but couldnt solve my problem. Have mentioned some below-
sigar-amd64-winnt.dll ... can't reference it or bundle it with .jar
How to include SIGAR API in Java Project
Any help would be appreciated..
EDIT
Launch4j gives the following Exception in its log when i test run the exe wrapper-
Exception in thread "main" java.lang.NoClassDefFoundError: org/hyperic/sigar/SigarException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.hyperic.sigar.SigarException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more