1

I know this is a quite common question but I think I tried every solution without success.

The error I get:

Native code library failed to load. 
java.lang.UnsatisfiedLinkError: no App_JavaAPI in java.library.path

I've appended the path to the directory of the App_JavaAPI.dll on PATH variable on Eclipse. I've tried to add the path to the file itself and even adding both on the PATH env variable defined at OS level.

Moreover, I've tried to put the line:

-Djava.library.path="path to the dir or to the dll itself"

with no success as well. In this case, if I put the path to the dll itself the error is still there. Otherwise, if I put only the path to the dir, I get the error:

java.lang.UnsatisfiedLinkError: path_to_the_dir\App_JavaAPI.dll: The network path was not found

Do you have any other advice?

Thanks all, Andrea

Akinn
  • 1,896
  • 4
  • 23
  • 36
  • The java.library.path should just contain the directory paths, not the complete name of the the .dll. As you are using Windows, I'd make sure that you are using the correct path separator (";"). rather than the Unix one (":"). This true even if you are using Cygwin. If you are setting this up from the Cygwin cmd line, make sure you are passing the Win path name, not the Cygwin (/cygdrive/c...") one, and check the slashes are being handled correctly. I'd recommend having your program print out the System.getProperties() and check for the presence "java.library.path" and that it is correct. – dan.m was user2321368 May 20 '19 at 15:03
  • I confirm I am using the proper separator ( ; ). I have changed the java.library.path with the dir instead of the dll and the error changed to "Network path was not found". – Akinn May 20 '19 at 15:05
  • The System.getProperties() returns the java.library.path set with the dir-path I passed. – Akinn May 20 '19 at 15:07
  • can you post -Djava.library.path="path to the dir or to the dll itself" but with the actual value? – Johan Claes May 20 '19 at 15:09
  • -Djava.library.path=C:\Andrea\develop_dir\LOGI\Tools\PARSER\3.7.0\install\Win2K_GCC\Release\lib – Akinn May 20 '19 at 15:14
  • please try adding quotes around your path : -Djava.library.path="C:\Andrea\develop_dir\LOGI\Tools\PARSER\3.7.0\install\Win2K_GCC\Release\lib" – Johan Claes May 20 '19 at 15:17
  • :( same result :( – Akinn May 20 '19 at 15:19
  • Maybe you cannot access the file in that folder because of file or folder permissions? – Johan Claes May 20 '19 at 15:28
  • In _Project > Properties: Java Build Path_, tab _Libraries_ select the _Native library location_ subnode of the JAR, click _Edit..._ and enter the directory that contains the DLL. – howlger May 20 '19 at 15:42
  • I have full permission on the dir. @howlger I tried your solution with no success – Akinn May 21 '19 at 07:19
  • @AndreaGiordano Please show the command line of the run configuration (there is a button _Show Command Line_ at the bottom of the run configuration dialog for that). – howlger May 21 '19 at 07:25
  • C:\Program Files (x86)\Java\jdk1.8.0_201\bin\javaw.exe "-Djava.library.path=C:\Andrea\develop_dir\LOGI\Tools\PARSER\3.7.0\install\Win2K_GCC\Release\lib" -Dfile.encoding=Cp1252 -classpath "C:\Users\Andrea.GIORDANO\Replay\Replay\bin;C:\Users\Andrea.GIORDANO\git\repository\CORE\lib\ActorJava.jar;C:\Users\Andrea.GIORDANO\git\repository\CORE\lib\App_JavaAPI.jar" com.andrea.replay.gui.ReplayGui "C:\Users\Andrea.GIORDANO\Desktop\Replay\java\data\context.xml" – Akinn May 21 '19 at 07:41

0 Answers0