JPL/SWI Prolog not working

筅森魡賤 提交于 2019-12-12 19:17:25

问题


I'm trying to use the SWI-Prolog JPL library, but I'm having problems.

I'm trying to let my Eclipse project access JPL, but when I try to start the program, I get the following error:

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no jpl in java.library.path

I copied the jpl.jar into my project directory, and I set it on the build path. Additionally, I pass the following VM arguments:

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

(That's the directory where Prolog was installed).

What am I doing wrong?


EDIT: I don't seem to have the libpl.dll anywhere on my computer. Could this be causing my problem?


回答1:


The jvm.dll of your running JDK/JRE must be available in your system PATH so that jpl.dll from java.library.path loads properly.

You have to take care to 32 bits / 64 bits consistency between your JPL installation and your running JVM - so do not try any mix.

Here is information from an old installation doc.

For such installation support, you should use the JPL mailing list.




回答2:


You should set the java.library.path to the folder where the jpl.dll file is located. As far as I know it is the Prolog\bin folder.




回答3:


A system-wide solution in a Mac environment (SWI-Prolog version 7.1.4 for x86_64-darwin13.1.0) would be to create the following symlink:

ln -s /usr/local/Cellar/swi-prolog/7.1.4/libexec/lib/swipl-7.1.4/lib/x86_64-darwin13.1.0/libjpl.jnilib /Library/Java/Extensions/libjpl.jnilib


来源:https://stackoverflow.com/questions/9751357/jpl-swi-prolog-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!