Protege complaints that Java VM could not be found

Post Reply
Beernink
Posts: 22
Joined: 26 Mar 2012, 00:57
Location: Wellington, New Zealand

Hi. I'm trying to get the prerequisites installed and everything seemed fine including Protege quite happily running the install. But when I try to run Protege 3.5 it comes up with a "Java VM could not be found. Please check your JAVA_HOME environment variable".

When I do an echo $JAVA_HOME it returns the correct "/usr/lib/jvm/java-1.8.0-openjdk-amd64" path. When I do a java-version it confirms:
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1ubuntu1_18.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)

So a bit lost. Any ideas? Incompability issue with the JDK version? Note that I'm running an Ubuntu 18.04 server on a virtual box.

Ron
Wellington, NZ
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Hi Ron,

Can you tell me how you are starting Protege?
Are you running the script <Protege Install>/bin/run_protege.sh?

That script is expecting to find a sub-directory, “jre/bin” inside the path that $JAVA_HOME is pointing to.

Inside that directory, the script is expecting to find an executable called ‘java’ - so the full path it’s looking for is:

Code: Select all

/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/bin/java
If you are launching Protege via the run_protege.sh script, then there should not be any incompatibility with the JVM - I’ve just launched it with a Java 1.8 JVM in this way without any issues.

Let’s confirm that your JRE is located where the launch script is expecting to find it and take it from there. If it’s in a slightly different location - e.g. if the script is assuming an Oracle-based Java and OpenJDK has a small variation in the directory structure, we can tweak the run_protege.sh script accordingly.

Jonathan
Essential Project Team
Beernink
Posts: 22
Joined: 26 Mar 2012, 00:57
Location: Wellington, New Zealand

Kia ora Jonathan. I have protege installed to "/opt/protege", and running it from that directory using "sudo sh ./run_protege.sh". "echo $JAVA_HOME" returns "/usr/lib/jvm/java-1.8.0-openjdk-amd64". There is indeed a "/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/bin/java".

I changed run_protege.sh to "JAVA_PATH=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/bin", and bingo - it works. But doesn't explain why "JAVA_PATH=$JAVA_HOME/jre/bin" wouldn't result in the same. Good to get it to work it is supposed to, so really appreciate your help!

Nga mihi nui (it is Maori language week here, so doing my bit to show our wonderful native language)
Ron
Post Reply