You'll need to have a modern JDK installed. We recommend JDK17 or higher. Any JDK distribution will work. Here are some recommended options:
- Ubuntu: Install one of the following packages...
You'll need the
javap tool from the JDK to build with Duchess. You'll want to configure the
JAVA_HOME environment variable to point to your JDK installation. Duchess will use it to locate
javap. Otherwise, Duchess will search for it on your
PATH. You can configure the environment variables used at build time via Cargo by creating a
.cargo/config.toml file (see this example from duchess itself).
Duchess relies on
javap to reflect Java type information at build time. It will not be invoked at runtime.
You will likely want to configure the
CLASSPATH for your Rust project as well. Like with
JAVA_HOME, you can do that via Cargo by creating a
By default, the
dylibjvm feature is enabled and Duchess will dynamically load and link libjvm at runtime. Like with
javap, it will first search for libjvm in
JAVA_HOME if set. Otherwise it will look for
java on your
PATH to locate the JRE installation. Non-standard installations can also be configured using
dylibjvm, libjvm must be statically linked.