I have a Maven project in Eclipse, where i added the Sigar library using
<dependency>
<groupId>org.fusesource</groupId>
<artifactId>sigar</artifactId>
<version>1.6.4</version>
</dependency>
This was compiling and executing smoothly under eclipse. When i created an executable jar i was getting an error, that the .so
file doesn't exist in the java.library.path.
DEBUG Sigar - no libsigar-amd64-linux.so in java.library.path
org.hyperic.sigar.SigarException: no libsigar-amd64-linux.so in java.library.path
After some research and reading (ok, more than some) i copied the lib folder of sigar (the one that holds all the .so files) under my project (i was not sure if I have to copy it to a specific place, so i put it under the project's root) and changed the maven dependency to that:
<dependency>
<groupId>org.fusesource</groupId>
<artifactId>sigar</artifactId>
<version>1.6.4</version>
<configuration>
<workingDirectory>${project.build.directory}/Sigar_lib</workingDirectory>
<mainClass>my.package.name.MyClass</mainClass>
<includeProjectDependencies>true</includeProjectDependencies>
</configuration>
</dependency>
Tried all different approaches to the <workingDirectory>
tag, with/without the build directory, forward/back slash and so on. Every time the jar fails to execute with the same error.
Any help please? Thank you