I'm trying to run a parser built in Java, but every time I try to use the class, I get the above error ("Exception in thread "main" java.lang.UnsupportedClassVersionError: danbikel/parser/Trainer (Unsupported major.minor version 50.0)").
From what I've read, this may be a problem with a mismatch between the versions of Java used to compile and run the code; but I've made sure that my JAVA_HOME environment is set to version 1.6, which is the version recommended by the parser's installation guide.
There are older versions of Java installed on the server, but I can't do anything about that. Is there anything else I can do about this error?
Use sudo update-alternatives --config java
and set the version you may want to use if you are using a Debian-derived distro (such as Ubuntu).
Aside from setting JAVA_HOME
appropriately (which you've done), ensure that you're executing the right version of the java
executable. e.g., on Debian or Ubuntu, execute /usr/lib/jvm/java-6-openjdk/jre/bin/java
directly, if /usr/bin/java
points to the wrong version.
You can use the -version
option to verify the version of the launcher you're using. Try java -version
and /usr/lib/jvm/java-6-openjdk/jre/bin/java -version
and see if the output is any different.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With