This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/jpl/jpl/docs/installation.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&nbsp;<span style="font-family: monospace;">jpl.zip</span>
somewhere
safe (maybe into the&nbsp;<span style="font-family: monospace;">\pl</span>
folder of your&nbsp;<span style="font-style: italic;">SWI-Prolog</span>
installation): it creates a folder&nbsp;<span
style="font-family: monospace;">\jpl</span>
which you should retain.
</p>
<p>Inspect your new&nbsp;<span style="font-family: monospace;">\jpl</span>
folder: it should contain
</p>
<pre style="margin-left: 40px;">jpl<br>&nbsp;+--- examples<br>&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp; +--- Exceptions<br>&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp; +--- Exceptions2<br>&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp; +--- Family<br>&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp; +--- Test<br>&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp; +--- Test2<br>&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp; +--- Time<br>&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp; +--- Zahed<br>&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp; +--- <i>(and maybe more...)<br>&nbsp;|<br></i>&nbsp;+--- docs <span
style="font-style: italic;"> (HTML files in here are accessible via links from the home page)</span><br>&nbsp;|<br>&nbsp;+--- src<br>&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp; +--- c<br>&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp; | +--- build.bat <span
style="font-style: italic;">(Windows script to recompile jpl.c to jpl.dll)</span><br>&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp; | +--- build.sh <span
style="font-style: italic;">(Linux script to recompile jpl.c to libjpl.so)</span><br>&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp; +--- java<br>&nbsp;|<br>&nbsp;+--- jpl.dll&nbsp; <span
style="font-style: italic;">(a native library - for Windows in this case)</span>
&nbsp;|
&nbsp;+--- jpl.jar&nbsp;<span
style="font-style: italic;"> (a Java library)</span>
&nbsp;|
&nbsp;+--- jpl.pl&nbsp; <span
style="font-style: italic;">(a Prolog library)</span>
&nbsp;|
&nbsp;+--- README.html&nbsp; <span
style="font-style: italic;">(<span style="font-weight: bold; font-style: italic;">JPL</span>'s documentation &quot;home page&quot;)</span>
</pre>
Put the three library files (<span style="font-family: monospace;">jpl.dll</span>,<span
style="font-family: monospace;"> jpl.jar</span>
and&nbsp;<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&nbsp;<span style="font-style: italic;">Windows&nbsp;</span>kernel,
and can go in any folder on your&nbsp;<span
style="font-family: monospace;">PATH</span>;
perhaps&nbsp;<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&nbsp;<span style="font-style: italic;">Java&nbsp;</span>VMs
(and compilers) used with&nbsp;<span
style="font-weight: bold; font-style: italic;">JPL</span>;
one possibility is to put it on your global&nbsp;<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&nbsp;<span style="font-style: italic;">SWI-Prolog</span>
engines used with&nbsp;<span
style="font-weight: bold; font-style: italic;">JPL</span>:
I suggest putting it in&nbsp;<span style="font-family: monospace;">%SWI_HOME_DIR%\library</span>
and then invoking&nbsp;<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&nbsp;<span style="font-style: italic;">SWI-Prolog</span> to
initialise
(or make the first call) to&nbsp;<span
style="font-weight: bold; font-style: italic;">JPL</span>,
it is necessary that a folder containing the&nbsp;<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&nbsp;<span style="font-style: italic;">Sun&nbsp;</span>JRE,
look for a PATH entry of the form&nbsp;<span
style="font-family: monospace;">C:\jdk1.3.1_01\jre\bin\hotspot;</span>
or&nbsp;<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&nbsp;<span
style="font-style: italic;">SWI-Prolog</span>,
it is necessary that the&nbsp;<span style="font-style: italic;">SWI-Prolog</span>
library&nbsp;<span style="font-family: courier new,courier,monospace;"><font
size="-1">libpl.dll</font></span>
is in a folder on the PATH<br>
&nbsp;<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.&nbsp; Then
check
the installation instruction s and prerequisites carefully.
<br>
&nbsp;
<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&nbsp;<span style="font-family: courier new,courier,monospace;"><font
size="-1">jpl.dll</font></span>
(please consult local&nbsp;<span style="font-style: italic;">Windows&nbsp;</span>expertise
if you don't know how to correct this).</div>
<ul>
<li>If&nbsp;<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>
&nbsp;</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.&nbsp;<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;">&nbsp;
<br>
then there is no Java executable&nbsp;<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&nbsp;<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&nbsp;<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&nbsp;<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>
&nbsp;
</body>
</html>