All Manuals > LispWorks® User Guide and Reference Manual > 15 Java interface

15.5 Initialization of the Java interface

The Java interface is a module which needs to be loaded by calling:

(require "java-interface")

Before doing any calls from Lisp to Java or from Java to Lisp or creating any Java object from Lisp, the Java interface must be initialized by a call to init-java-interface. init-java-interface can either connect to an already running Java virtual machine, or load the JVM library and start it. It has various keyword arguments to set global values.

On Android and in dynamic libraries that were delivered with setup-deliver-dynamic-library-for-java with true for init-java (the default), the system automatically calls init-java-interface on startup.

Merely defining callers to Java and proxies does not use Java. Importing classes needs Java to do the expansion, so will require initializing the Java interface. See discussion in 15.2.1 Importing classes.

LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:20