5

I have a problem installing jpl library. I installed the latest swipl version (but I tried also unstable versions before):

SWI-Prolog 7.2.3 for Windows 7/8/10 64-bit edition

Then I added dependent paths to environment variables:

Variable: SWI_HOME_DIR 
Value: C:\Program Files\swipl

Then I added, to Path these values:

%SWI_HOME_DIR%\lib\jpl.jar;
%SWI_HOME_DIR%\lib;
%SWI_HOME_DIR%\bin

I also added the VM argument like this:

-Djava.library.path="C:\Program Files\swipl\bin"

to make sure that Eclipse sees this folder.

After that I still get the error:

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: C:\Program Files\swipl\bin\jpl.dll: Can't find dependent libraries
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1937)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1855)
    at java.lang.Runtime.loadLibrary0(Runtime.java:870)
    at java.lang.System.loadLibrary(System.java:1122)
    at org.jpl7.JPL.loadNativeLibrary(JPL.java:79)
    at org.jpl7.fli.Prolog.<clinit>(Prolog.java:41)
    at org.jpl7.Query.open(Query.java:260)
    at org.jpl7.Util.textToTerm(Util.java:102)
    at org.jpl7.Query.Query1(Query.java:129)
    at org.jpl7.Query.<init>(Query.java:120)

I'm 100% sure, that Eclipse sees that jpl.dll file, but in my opinion, it seems that it needs some other libraries.

I know that this thread is probably duplicate of either of these:

jpl.dll: Can't find dependent libraries
JPL Can't find dependent libraries of jpl.dll

but these questions are not answered or the answers doesn't helps in my case.

Community
  • 1
  • 1
user3448282
  • 2,629
  • 3
  • 25
  • 47
  • I try run `swipl` sample using the setting of this question, but I cannot reproduce the error. Do you get similar error when you try to execute the program from command line? If yes, you should make sure all required DLL available using [Dependency Walker](http://www.dependencywalker.com) – Beck Yang Jan 12 '17 at 12:20

1 Answers1

0

I added dependent paths to environment variables: Variable: SWI_HOME_DIR

Value: C:\Program Files\swipl

Then I added, to Path these values:

%SWI_HOME_DIR%\lib\jpl.jar;
%SWI_HOME_DIR%\lib;

%SWI_HOME_DIR%\bin

This is the installation instructions:

Put the three library files (jpl.dll, jpl.jar and jpl.pl) where each can be found:

  • jpl.dll must be found by the Windows kernel, and can go in any folder on your PATH environment variable; perhaps %SWI_HOME_DIR%\bin or your Windows system folder

  • jpl.jar must be found by any Java VM's (and compilers) used with JPL. One possibility is to put it on your global CLASSPATH.

  • jpl.pl is a Prolog source module, and must be found by any SWI-Prolog engines used with JPL: I suggest putting it in %SWI_HOME_DIR%\library and then invoking make_library_index/1 on that folder (see a SWI-Prolog manual for details) so that the autoloader can find it.

Anton Danilov
  • 1,246
  • 11
  • 26