JPL Installation
Written by:Sadi Evren SEKER
aim of thitutorial: JPL - java prolog package step by step installation
jpl is a very usefull package for prolog codes under java. I have implemented graphical user interfaces for my prolog based projects by this great tool. I have written such a tutorial because of difficulties i have faced during installation.
first download the tar.gz file (i have installed jpl-1.0.1)
unpack it by tar zxvf jplxxx.tar.gz command
cd jpl-1.0.1
install swi-prolog from swi-prolog.com
copy files under /usr/lib/pl-5.0.10/include/
to /usr/include (in my installation i have solved the swi header files problem by this way)
if everything is same, most probably you will get an error message if you type make; problem is the ./src directory. go to this directory error is:
gcc -shared -Wl,-soname,jpl.so -o ../lib/libjpl.so jpl_fli_Prolog.o -L/opt/pl/lib/pl-3.1.2/runtime/powerpc-linux -lpl -ldl -lreadline -ltermcap -lm
problem is the architecture. in my case following is a solution:
cc -shared -Wl,-soname,jpl.so -o ../lib/libjpl.so jpl_fli_Prolog.o -L/usr/lib/pl-5.0.10/runtime/i686-linux/ -lpl -ldl -lreadline -ltermcap -lm
since my architecture is i686 and my installation is under /usr/lib/pl...
now you need to add java bin to a visible path (such as export PATH=/usr/java/j2sdk1.4.1/bin)
finally type make to build the installation
after installation you need to add the new files to your CLASSPATH (just type export CLASSPATH=/jpl-1.0.1/lib/jpl.jar:.:/usr/java/j2sdk1.4.1/lib
again some more directory settings :
export LD_LIBRARY_PATH=/jpl-1.0.1/lib
export JAVA_HOME=/usr/java/j2sdk1.4.1
now you can try jpl under test directory
goto ./test directory and type javac Test.java
now see result by java Test
Test.java can communicate with test.pl which is wonderful
Last updated, by Sadi Evren SEKER, 12/07/2003 - 02:10 am