JPL/SWI Prolog configuration failure

≯℡__Kan透↙ 提交于 2019-11-29 12:51:50

I've sent the problem to the official mailing list (swi-prolog@lists.iai.uni-bonn.de) provided by swi-prolog.org, and luckily someone helped me to prove that there are some problems in the version 6.2.0. We then both tried the version 6.0.2, and it works perfectly. He mentioned that (and I noticed that) there is no swipl.dll in the bin folder of the version 6.2.0, which MAY causes the issue.

I've already reported the issue to the staff via Email, and at least for now, I suggest that people who want to configure JPL should download the version 6.0.2. Three things to remember:

  1. add a new variable SWI_HOME_DIR under system variables in environment variables, and set the path to the place where you installed the SWI-Prolog (Mine is D:\swipl);

  2. Add the path %SWI_HOME_DIR%\bin to your PATH variable, rather than use something like "D:\swipl\bin". (Otherwise [FATAL ERROR: Could not find system resources] will occur)

  3. Add the path %SWI_HOME_DIR%\lib\jpl.jar to your PATH variable, rather than use something like "D:\swipl\lib\jpl.jar". (Otherwise [FATAL ERROR: Could not find system resources] will occur)

If you are using Eclipse for Java development, it seems that you DO NOT need to configure in your IDE. As long as you follow the 3 steps above and add the correct jar file as an external library, it should be fine.

I'm not sure whether the temporary solution works for everyone, but definitely, everyone who has the issue should try this method first. As long as the issue in the version 6.2.0 has been figured out, I'll add some comments here.

BTW, as far as I know, until now, people who have the issue are using 32-bit Windows.

Try adding your path to java.library.path via Run > Run Configuration > [project name] and add the following under "VM Arguments" tab.

-Djava.library.path="D:\swipl\bin;."

Furthermore, under the "Environment" tab, add the following:

VARIABLE: PATH
VALUE: D:\swipl\bin;${env_var:PATH}

After that, go to Project > Properties > Java Build Path, select "Libraries" tab. Click "Add External JARS.." and find your jpl.jar.

Great Great Great, second answer is the solution

  1. create SWI_HOME_DIR variable to set the swi prolog instalation directory SWI_HOME_DIR ------- C:\Program Files\swipl
  2. set PATH to point to the library and bin like this PATH ------ %SWI_HOME_DIR%\bin;%SWI_HOME_DIR%\lib\jpl.jar

This fix my problem "Exception in thread "main" java.lang.UnsatisfiedLinkError: no jpl in java.library.path windows" it is a little bit rare but it works find.

I had the same problem. In addition to set the PATH, you need to verify if the installed SWI program has the same architecture (32 or 64) of your JVM.

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