The Jasper library module is the Prolog interface to the Java VM. It
corresponds to the se.sics.jasper
package in Java. It is loaded
by executing the query:
| ?- use_module(library(jasper)).
It is recommended that the reader first reads Mixing Java and Prolog, as that chapter contains important information on how to use Java and Prolog together.
The Jasper library fully supports multiple SICStus run-times in a process.
Jasper cannot be used when the SICStus run-time is statically linked to
the executable, such as when using spld --static
.
The following functionality is provided:
jasper_initialize/[1-2]
, jasper_deinitialize/1
).
jasper_new_object/5
).
jasper_call/4
).
jasper_create_global_ref/3
,
jasper_delete_global_ref/2
,
jasper_delete_local_ref/2
). Global references are used to prevent
the JVM from garbage collecting a Java object referenced from Prolog.
library('jasper/examples')
).