JPL / SWI Prolog配置失败 [英] JPL/SWI Prolog configuration failure

查看:160
本文介绍了JPL / SWI Prolog配置失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在正在配置JPL,并希望使用java进行swi-prolog。

I'm configuring the JPL right now, and wanna work with swi-prolog using java.

我下载了SWI-Prolog的最新稳定版本,这是6.2.0,并安装在D:\ swipl

I downloaded the newest stable version of SWI-Prolog, which is 6.2.0, and installed in D:\swipl

首先,我将以下路径添加到PATH virable:D:\swipl \ bin,这应该是包括所有需要的dll文件。

First, I added the following path to the PATH virable: D:\swipl\bin, which should include all dll files needed.

然后,我将以下路径添加到CLASSPATH virable:D:swipl \lib \ _jpl.jar,应该是jar需要文件。

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)

在线搜索后,我发现很多人只是得到 java.lang.UnsatisfiedLinkError:java.library.path中没有jpl 这是因为 PATH 变量的设置,而不是我在这里得到的错误: java.lang.UnsatisfiedLinkError:jpl.fli.Prolog .thread_self()我(是的,行尾有我)。

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).

有没有人得到这个错误之前?我已经尝试了几个以前版本的SWI-Prolog,但也有其他类型的错误。我正在使用Eclipse IDE进行Java开发 - 我错过了什么吗?

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?

推荐答案

我已将问题发送给官方swi-prolog.org提供的邮件列表(swi-prolog@lists.iai.uni-bonn.de),幸运的是有人帮助我证明版本6.2.0中存在一些问题。然后我们都尝试了6.0.2版本,它完美无缺。他提到(我注意到)版本6.2.0的bin文件夹中没有swipl.dll,这可能导致问题。

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.

我是已经通过电子邮件向员工报告了这个问题,至少现在,我建议那些想要配置JPL的人应该下载6.0.2版本。要记住三件事:

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. 在环境变量中的系统变量下添加一个新变量SWI_HOME_DIR,并设置路径到的地方你安装了SWI-Prolog(我的是D:\swipl);

  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);

将路径%SWI_HOME_DIR%\ bin添加到PATH变量中,而不是使用D:\ swipl \ bin之类的东西。 (否则将发生[致命错误:无法找到系统资源])

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)

将路径%SWI_HOME_DIR%\ lib \ jpl.jar添加到PATH变量,而不是使用D:\ swipl \lib \ jpl.jar之类的东西。 (否则会出现[致命错误:无法找到系统资源])

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)

如果您使用Eclipse进行Java开发,似乎您不需要在IDE中进行配置。只要你按照上面的3个步骤并添加正确的jar文件作为外部库,它应该没问题。

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.

我不确定临时解决方案是否有效对于每个人,但绝对有问题的每个人都应该首先尝试这种方法。只要版本6​​.2.0中的问题已经找到,我就会在这里添加一些评论。

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,就我所知,直到现在,有问题的人使用的是32位Windows。

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

这篇关于JPL / SWI Prolog配置失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆