Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can I plug in Swi-prolog in Eclipse

476 views
Skip to first unread message

vnpet...@gmail.com

unread,
Apr 11, 2008, 1:24:36 PM4/11/08
to
I'm trying to plug in Swi-prolog (include already jpl) to Eclipse. I
use "gems-emf-intelligence-prolog-beta-1.01" like instruction.
=====================================
You need to download and install SWI Prolog from
http://www.swi-prolog.org/download.html. After
installing SWI, you must copy the jpl.jar from SWI's
bin directory to the lib directory in this plug-in.
If it is not named exactly "jpl.jar", you must
rename it to 'jpl.jar'.

Finally, you must add the SWI's bin directory to your
system PATH variable. In Windows, you MUST restart
your system for SWI to become visible to the Refresh
Prolog plug-in.
======================================
When I create a servlet called PrologServ and a jsp file called
index.jsp that can call PrologServ.

But when the browser is "http://localhost/proServ/Prologserv" . It
generate an error

java.lang.NoClassDefFoundError: jpl/JPL.
I have the code in java JPL.init();

vnpet...@gmail.com

unread,
Apr 11, 2008, 1:51:40 PM4/11/08
to
On Apr 12, 12:24 am, vnpeter...@gmail.com wrote:
> I'm trying to plug in Swi-prolog (include already jpl) to Eclipse. I
> use "gems-emf-intelligence-prolog-beta-1.01" like instruction.
> =====================================
> You need to download and install SWI Prolog fromhttp://www.swi-prolog.org/download.html. After

> installing SWI, you must copy the jpl.jar from SWI's
> bin directory to the lib directory in this plug-in.
> If it is not named exactly "jpl.jar", you must
> rename it to 'jpl.jar'.
>
> Finally, you must add the SWI's bin directory to your
> system PATH variable. In Windows, you MUST restart
> your system for SWI to become visible to the Refresh
> Prolog plug-in.
> ======================================
> When I create a servlet called PrologServ and a jsp file called
> index.jsp that can call PrologServ.
>
> But when the browser is "http://localhost/proServ/Prologserv" . It
> generate an error
>
> java.lang.NoClassDefFoundError: jpl/JPL.
> I have the code in java JPL.init();

Friends Please help me to solve it
I really need to solve it asap.
Thanks in advance

Paul Singleton

unread,
Apr 11, 2008, 4:28:14 PM4/11/08
to
vnpet...@gmail.com wrote:
> I'm trying to plug in Swi-prolog (include already jpl) to Eclipse. I
> use "gems-emf-intelligence-prolog-beta-1.01" like instruction.
> =====================================
> You need to download and install SWI Prolog from
> http://www.swi-prolog.org/download.html. After
> installing SWI, you must copy the jpl.jar from SWI's
> bin directory to the lib directory in this plug-in.

jpl.jar is not found in "SWI's bin directory" but in
its lib directory i.e. pl/lib

> If it is not named exactly "jpl.jar", you must
> rename it to 'jpl.jar'.

If it is not named exactly "jpl.jar" then it is not
jpl.jar ;-)

Following this poor advice, perhaps you have copied
pl/bin/jpl.dll and renamed it?

> Finally, you must add the SWI's bin directory to your
> system PATH variable. In Windows, you MUST restart
> your system for SWI to become visible to the Refresh
> Prolog plug-in.

This "MUST" is not a must for XP at least, and there are
less global ways to make SWI's bin directory available to
an Eclipse project.

> ======================================
> When I create a servlet called PrologServ and a jsp file called
> index.jsp that can call PrologServ.
>
> But when the browser is "http://localhost/proServ/Prologserv" . It
> generate an error
>
> java.lang.NoClassDefFoundError: jpl/JPL.
> I have the code in java JPL.init();

It's not finding jpl.jar (see above).

cheers - Paul Singleton

vnpet...@gmail.com

unread,
Apr 12, 2008, 4:48:39 AM4/12/08
to
On Apr 12, 3:28 am, Paul Singleton <p...@jbgb.com> wrote:

Thank Paul, now I'm still have problem with that thing.
- I have jpl.jar in the folder C:\eclipse\plugins
\org.refresh.prolog_1.0.0\lib

- When I created Servlet project, I need to add both External Archive
from C:\eclipse\plugins\org.refresh.prolog_1.0.0\lib and c:\program
files\pl\lib\jpl.jar.

- I use PL w32pl5652.
- Then I export my project into war file. Then call "http://localhost/
proServ/Prologserv" in the browse. It
generate an error

java.lang.NoClassDefFoundError: jpl/JPL.

I have the code in java JPL.init();

Thanks friends

Oleh

unread,
Feb 14, 2013, 1:39:44 PM2/14/13
to
I solved it by sysloading a library from within JAVA and setting classpath.

the preloading had to be done in right order:


- pthreadVC.dll
- libpl.dll
- jpl.dll

then it worked.
0 new messages