Node:Running Java from SICStus, Next:, Previous:UNIX, Up:Getting Started



Running Java from SICStus

If SICStus is used as parent application, things are usually really simple. Just execute the query | ?- use_module(library(jasper)).. After that, it is possible to perform meta-calls as described in Jasper Library Predicates.

On UNIX, you may encounter the following error message:

     % sicstus
     SICStus 3.8 (sparc-solaris-5.5.1): Wed Sep 22 08:42:14 MET DST 1999
     Licensed to SICS
     | ?- use_module(library(jasper)).
     [...]
     {SYSTEM ERROR: 'Attempted to load Java engine into sbrk\'d
     SICStus system (try starting SICStus with -m option)'}
     [...]
     

Since most platforms don't allow sbrk() and malloc() (or threads) to coexist peacefully, SICStus refuses to load the JVM if not the -m flag was given to SICStus. The message can, as the error message suggests, be avoided if SICStus is started with the -m flag:

     % sicstus -m
     
The -m flag is not needed, and is ignored, on Windows.

When Jasper is used in run-time systems, additional constraints apply as described in Runtime Systems on Target Machines. The Java to SICStus interface relies on dynamically loading the SICStus run-time system. For this reason, it is not possible to use library(jasper) from an executable that links statically with the SICStus run-time.