1

The personal finance program Moneydance is Java-based, so I'd expect to be able to run Moneydance in Ubuntu 20.10 on my Raspberry Pi 4 -- but it complains about the Java version -- MD says:

No suitable Java Virtual Machine could be found on your system.
The version of the JVM must be at least 14.
Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.

I eventually figured out how to get it to work, but there are lots of outdated or irrelevant links on this topic, so I'm posting my answer here in the hope that it helps someone else.

1 Answer 1

3

First, install Moneydance -- conveniently, you can download a .deb right from the website. The package seems to include its own Java, but it's compiled for x86 platforms and obviously doesn't work on the Raspberry Pi.

So it's up to us to provide the right JVM for Moneydance. The default-jre package is version 11, so you'll need to install openjdk-14-jre and set INSTALL4J_JAVA_HOME=/usr/lib/jvm/java-14-openjdk-arm64 -- you can either use export in your shell, or edit the /opt/Moneydance/Moneydance script.

But then, it still doesn't work:

Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.controls not found

So you need to install the openjfx package. But for some reason, that puts its files in /usr/share/java and Moneydance can't find them. It turns out that you need to use the --module-path switch when starting MD to specify the correct directory -- I edited the Moneydance script, and at the very end, when it runs $INSTALL4J_JAVA_PREFIX exec "$app_java_home/bin/java" ... I added

--module-path /usr/share/java

But that doesn't work:

Error occurred during initialization of boot layer
java.lang.module.FindException: Two versions of module org.apache.commons.lang3 found in /usr/share/java (commons-lang3.jar and commons-lang3-3.11.jar)

This is because that directory has symlinks that confuse Java; this is Debian bug 933669. My solution was to make a new directory somewhere -- I used /opt/Moneydance/jfx -- and symlink from there to the .jar files we need:

javafx-base.jar -> /usr/share/java/javafx-base.jar
javafx-controls.jar -> /usr/share/java/javafx-controls.jar
javafx-graphics.jar -> /usr/share/java/javafx-graphics.jar
javafx-swing.jar -> /usr/share/java/javafx-swing.jar

Specify that directory in your module path in the Moneydance script:

--module-path /opt/Moneydance/jfx  # or whatever directory you used

...and then you can run Moneydance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.