182 lines
8.2 KiB
HTML
182 lines
8.2 KiB
HTML
<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type"
|
|
content="text/html; charset=iso-8859-1">
|
|
<meta name="Author" content="Paul Singleton">
|
|
<meta name="GENERATOR"
|
|
content="Mozilla/4.74 [en] (WinNT; U) [Netscape]">
|
|
<title>JPL 3.x installation</title>
|
|
</head>
|
|
<body>
|
|
<h1><span style="font-style: italic;">
|
|
JPL 3.x</span> installation</h1>
|
|
<hr width="100%">
|
|
First check that the prerequisites (see the home page) are satisfied
|
|
(you have SWI-Prolog 5.2.0 or later, a Java 2 SDK, and a compatible
|
|
operating
|
|
system).
|
|
<p>Unzip <span style="font-family: monospace;">jpl.zip</span>
|
|
somewhere
|
|
safe (maybe into the <span style="font-family: monospace;">\pl</span>
|
|
folder of your <span style="font-style: italic;">SWI-Prolog</span>
|
|
installation): it creates a folder <span
|
|
style="font-family: monospace;">\jpl</span>
|
|
which you should retain.
|
|
</p>
|
|
<p>Inspect your new <span style="font-family: monospace;">\jpl</span>
|
|
folder: it should contain
|
|
</p>
|
|
<pre style="margin-left: 40px;">jpl<br> +--- examples<br> | +--- Exceptions<br> | +--- Exceptions2<br> | +--- Family<br> | +--- Test<br> | +--- Test2<br> | +--- Time<br> | +--- Zahed<br> | +--- <i>(and maybe more...)<br> |<br></i> +--- docs <span
|
|
style="font-style: italic;"> (HTML files in here are accessible via links from the home page)</span><br> |<br> +--- src<br> | +--- c<br> | | +--- build.bat <span
|
|
style="font-style: italic;">(Windows script to recompile jpl.c to jpl.dll)</span><br> | | +--- build.sh <span
|
|
style="font-style: italic;">(Linux script to recompile jpl.c to libjpl.so)</span><br> | +--- java<br> |<br> +--- jpl.dll <span
|
|
style="font-style: italic;">(a native library - for Windows in this case)</span>
|
|
|
|
|
+--- jpl.jar <span
|
|
style="font-style: italic;"> (a Java library)</span>
|
|
|
|
|
+--- jpl.pl <span
|
|
style="font-style: italic;">(a Prolog library)</span>
|
|
|
|
|
+--- README.html <span
|
|
style="font-style: italic;">(<span style="font-weight: bold; font-style: italic;">JPL</span>'s documentation "home page")</span>
|
|
|
|
</pre>
|
|
Put the three library files (<span style="font-family: monospace;">jpl.dll</span>,<span
|
|
style="font-family: monospace;"> jpl.jar</span>
|
|
and <span style="font-family: monospace;">jpl.pl</span>) where
|
|
each
|
|
can be found:
|
|
<ul>
|
|
<li> <span style="font-family: monospace;">jpl.dll</span> must be
|
|
found
|
|
by the <span style="font-style: italic;">Windows </span>kernel,
|
|
and can go in any folder on your <span
|
|
style="font-family: monospace;">PATH</span>;
|
|
perhaps <span style="font-family: monospace;">%SWI_HOME_DIR%\bin</span>
|
|
or your Windows system folder<span style="font-family: monospace;"></span></li>
|
|
<li> <span style="font-family: monospace;">jpl.jar</span> must be
|
|
found
|
|
by any <span style="font-style: italic;">Java </span>VMs
|
|
(and compilers) used with <span
|
|
style="font-weight: bold; font-style: italic;">JPL</span>;
|
|
one possibility is to put it on your global <span
|
|
style="font-family: monospace;">CLASSPATH</span></li>
|
|
<li> <span style="font-family: monospace;">jpl.pl</span> is a Prolog
|
|
source
|
|
module, and must be found by any <span style="font-style: italic;">SWI-Prolog</span>
|
|
engines used with <span
|
|
style="font-weight: bold; font-style: italic;">JPL</span>:
|
|
I suggest putting it in <span style="font-family: monospace;">%SWI_HOME_DIR%\library</span>
|
|
and then invoking <span
|
|
style="font-family: helvetica,arial,sans-serif;">make_library_index/1</span>
|
|
on that folder (see a<span style="font-style: italic;"> SWI-Prolog</span>
|
|
manual for details) so that the autoloader can find it.</li>
|
|
</ul>
|
|
For <span style="font-style: italic;">SWI-Prolog</span> to
|
|
initialise
|
|
(or make the first call) to <span
|
|
style="font-weight: bold; font-style: italic;">JPL</span>,
|
|
it is necessary that a folder containing the <span
|
|
style="font-style: italic;">JVM</span>library
|
|
(<span style="font-family: monospace;">jvm.dll</span>) is on your PATH;
|
|
if you are using a recent <span style="font-style: italic;">Sun </span>JRE,
|
|
look for a PATH entry of the form <span
|
|
style="font-family: monospace;">C:\jdk1.3.1_01\jre\bin\hotspot;</span>
|
|
or <span style="font-family: monospace;">C:\jdk1.3.1_01\jre\bin\client;
|
|
<br>
|
|
</span><br>
|
|
If your applications start in Java, and then call <span
|
|
style="font-style: italic;">SWI-Prolog</span>,
|
|
it is necessary that the <span style="font-style: italic;">SWI-Prolog</span>
|
|
library <span style="font-family: courier new,courier,monospace;"><font
|
|
size="-1">libpl.dll</font></span>
|
|
is in a folder on the PATH<br>
|
|
<br>
|
|
Try the Java example in
|
|
<pre style="margin-left: 40px;">examples/java/Versions</pre>
|
|
or the Prolog example in
|
|
<pre style="margin-left: 40px;">examples/prolog/jpl_versions_demo.pl<br></pre>
|
|
to confirm that all three libraries are installed and compatible.<br>
|
|
<h3>Installation troubleshooting</h3>
|
|
If the example programs don't run successfully, look carefully at any
|
|
error
|
|
messages; they typically indicate where the problem lies. Then
|
|
check
|
|
the installation instruction s and prerequisites carefully.
|
|
<br>
|
|
|
|
<ul>
|
|
<li>If you get a message about</li>
|
|
</ul>
|
|
<pre style="margin-left: 80px; font-weight: bold; font-style: italic;">... jpl.dll ... Access is denied ...</pre>
|
|
<div style="margin-left: 40px;">then you may have lost execute
|
|
permission
|
|
on <span style="font-family: courier new,courier,monospace;"><font
|
|
size="-1">jpl.dll</font></span>
|
|
(please consult local <span style="font-style: italic;">Windows </span>expertise
|
|
if you don't know how to correct this).</div>
|
|
<ul>
|
|
<li>If <span style="font-family: courier new,courier,monospace;"><font
|
|
size="-1">jpl_examples/0</font></span>
|
|
complains that</li>
|
|
</ul>
|
|
<div style="margin-left: 80px;"><span
|
|
style="font-weight: bold; font-style: italic;">The
|
|
dynamic link library jvm.dll could not be found in the specified path</span>
|
|
<br>
|
|
</div>
|
|
<div style="margin-left: 40px;">then you should locate jvm.dll within
|
|
the
|
|
Java runtime which you intend to use, and ensure that its directory is
|
|
within the PATH.</div>
|
|
<ul>
|
|
<li>if the Java examples (e.g. <span
|
|
style="font-family: courier new,courier,monospace;"><font size="-1">jpl\examples\Exception\run.bat</font></span>)
|
|
complain that</li>
|
|
</ul>
|
|
<div style="margin-left: 80px;"><span style="font-weight: bold;"><span
|
|
style="font-style: italic;">The
|
|
name specified is not recognized as an internal or external command,
|
|
operable
|
|
program or batch file.</span>
|
|
<br>
|
|
</span></div>
|
|
<div style="margin-left: 40px;">
|
|
<br>
|
|
then there is no Java executable <span
|
|
style="font-family: courier new,courier,monospace;"><font size="-1">java.exe</font></span>
|
|
in any folder on your PATH: you should have a PATH entry such as <span
|
|
style="font-family: courier new,courier,monospace;"><font size="-1">C:\jdk1.3.1_01\bin;</font></span></div>
|
|
<ul>
|
|
<li>if the Java examples complain that</li>
|
|
</ul>
|
|
<div style="margin-left: 80px;"><span
|
|
style="font-weight: bold; font-style: italic;">The
|
|
dynamic link library libpl.dll could not be found in the specified path</span></div>
|
|
<div style="margin-left: 40px;">or</div>
|
|
<div style="margin-left: 80px;"><span
|
|
style="font-weight: bold; font-style: italic;">Exception
|
|
in thread "main" java.lang.UnsatisfiedLinkError: C:\paul\bin\jpl.dll:
|
|
Can't
|
|
find dependent libraries
|
|
<br>
|
|
</span></div>
|
|
<div style="margin-left: 40px;">then there is no SWI-Prolog
|
|
library <span style="font-family: courier new,courier,monospace;"><font
|
|
size="-1">libpl.dll</font></span>
|
|
in any folder on your PATH: you should have a PATH entry such as <span
|
|
style="font-family: courier new,courier,monospace;">C:\Program
|
|
Files\pl\bin</span><br>
|
|
</div>
|
|
<br>
|
|
<hr style="width: 100%; height: 2px;">
|
|
<address><a href="mailto:paul.singleton@bcs.org.uk">Paul Singleton</a></address>
|
|
<address>
|
|
February 2004</address>
|
|
<br>
|
|
|
|
</body>
|
|
</html>
|