JPL: The Prolog <-> Java interface
Failed to load latest commit information.
ac fix openjdk9 directory check for linux Apr 4, 2018
cmake PORT: Try to find junit.jar in Darwin locations. Oct 12, 2018
docs Update default.html Nov 6, 2018
examples Install examples using cmake Sep 16, 2018
src Small JavaDoc improvements Nov 9, 2018
web * More issues Dec 1, 2004
.gitignore Ignore IntelliJ and Maven aux outputs Oct 12, 2018
CMakeLists.txt TEST: java_in_prolog also requires junit.jar Oct 31, 2018
ChangeLog Updated ChangeLog Sep 19, 2009
ISSUES PORT: Avoid the use of ARCH in favor of PLARCH Jun 3, 2011
LICENSE Added LICENSE file Oct 16, 2018 ADDED: library(jpl_config) to perform post-installation configuration. Sep 29, 2017
Makefile.mak Removed manifest creation from the Makefile Mar 2, 2010 Updated docs and distribution info. Oct 16, 2018
aclocal.m4 * Added new files Sep 21, 2004
config.guess PORT: Updated config.{guess,sub} Oct 7, 2012
config.h.cmake CMAKE: Build and install and Sep 10, 2018
config.sub PORT: Updated config.{guess,sub} Oct 7, 2012 ADDED: library(jpl_config) to perform post-installation configuration. Sep 29, 2017 REINDENT: 4 spaces Dec 18, 2016
install-sh * Added new files Sep 21, 2004
jpl.doc DOC: Point at wiki. Nov 1, 2018 Fix details to make build work on Windows Oct 15, 2018 PORT: jpl_config_dylib/0: support libjawt.dylib and do not complain a… Oct 8, 2018
make.bat * Added new files Sep 21, 2004 PORT: Do not fail the installation if junit.jar cannot be found. Jan 16, 2018 CTEST: Make JPL test for Prolog in Java work Oct 9, 2018 * Merged JPL 3.1 Nov 28, 2006
testenv * Updated comments Oct 27, 2006

JPL - Java <-> SWI Prolog Interface

JPL is a set of Java classes and C functions providing a bidirectional interface between Java and Prolog. JPL uses the Java Native Interface (JNI) to connect to a Prolog engine through the Prolog Foreign Language Interface (FLI). JPL is not a pure Java implementation of Prolog; it makes extensive use of native implementations of Prolog on supported platforms.

In its current version, JPL supports the embedding of a Prolog engine within the Java VM as well as the embedding of a Java VM within Prolog, so that, for example, one could take advantage of the rich class structure of the Java environment from within Prolog.

JPL is designed in two layers, a low-level interface to the Prolog FLI and a high-level Java interface for the Java programmer who is not concerned with the details of the Prolog FLI. The low-level interface is provided for C programmers who may wish to port their C implementations which use the FLI to Java with minimal fuss. The current version of JPL only works with SWI-Prolog.

JPL has been integrated into the full SWI-Prolog distribution starting with version 5.4.x and is included in the binary packages provided by Binary packages provided by 3rd parties may differ, not providing JPL or providing it as a separate package.

Further documentation


The objectives of JPL are to:

  1. enable Prolog applications to exploit any Java classes, instances, methods etc. (without requiring any wrappers, metadata etc. to be set up first);
  2. enable Java applications to manipulate any Standard Prolog libraries, predicates, etc. (without requiring any wrappers, metadata etc. to be set up first); and
  3. enable hybrid Prolog+Java applications to be designed and implemented so as to take best advantage of both language systems, and to be testable, debuggable, maintainable.

.. while also aim for:

  • minimum impact deployability: runtime support for Prolog+Java apps must be a position-independent, self-sufficient filestore tree, requiring no changes to registries, system libraries, system configuration files etc.
  • minimum dependency deployability: as with JVMs, the Prolog+Java runtime support must depend upon nothing which cannot be taken for granted in healthy OS installations
  • minimum vulnerability deployability: the Prolog+Java runtime support must be immune to legitimate variations in its environment (PATH settings, other applications and libraries including other Prolog+Java apps, etc.)


JPL is released under the terms of the Simplified BSD License. See LICENSE file.