Using JRE included with Snap 11

We’re attempting to run the toolbox on a cloud machine that doesn’t have Java installed. We do this by installing Snap on one of our desktops, creating a tar archive of the installation directory, and unpacking that on the cloud machine later. Since the snap installation directory contains a /jre subdirectory with Java 11, I should be able to add that to my PATH, set JAVA_HOME and/or INSTALL4J_JAVA_HOME to point at it.

Instead, when we run on the cloud machine, we get “Exit code: 83, Command failed with output No suitable Java Virtual Machine could be found on your system. The version of the JVM must be 11.”

The desktop we install on is running openjdk 17, so maybe that’s interfering with the snap installation and resulting in a “broken” /jre directory somehow?

The PATH and JAVA_HOME variables are not used by SNAP.
Instead, the path to the JRE is defined in the snap.conf file, located in the etc folder of the installation directory.

So, if you have moved everything correctly it should work.


EOMasters_icon_60 Marco from EOMasters - Mastering Earth Observation - Kofi_cup_40x30

2 Likes