I'm configuring the JPL right now, and wanna work with swi-prolog using java.
I downloaded the newest stable version of SWI-Prolog, which is 6.2.0, and installed in D:\swipl
First, I added the following path to the PATH virable: D:\swipl\bin, which should include all dll files needed.
Then, I added the following path to the CLASSPATH virable: D:swipl\lib\jpl.jar, which should be the jar file needed.
When I tried to run the versions example provided, I got the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: jpl.fli.Prolog.thread_self()I
at jpl.fli.Prolog.thread_self(Native Method)
at jpl.Query.open(Query.java:286)
at jpl.Util.textToTerm(Util.java:162)
at jpl.Query.Query1(Query.java:183)
at jpl.Query.<init>(Query.java:176)
at Versions.main(Versions.java:11)
After searching online, I found that many people just get java.lang.UnsatisfiedLinkError: no jpl in java.library.path
which is because of the setting for the PATH
variable, rather than the error I get here: java.lang.UnsatisfiedLinkError: jpl.fli.Prolog.thread_self()I
(and yes, there is a "I" at the end of the line).
Has anyone gotten this error before? I've tried several previous version of SWI-Prolog, but also got other kinds of errors. I'm using Eclipse IDE for Java development -- have I missed anything?