Exception in thread "main" java.lang.UnsupportedClassVersionError: com/xmodulo/hmon/gui/NetConf : Unsupported major.minor version 51.0
When a Java program is compiled, the build environment sets a "target" which is the oldest JRE version the program can support. If you run the Java program on a Linux system which does not meet the lowest JRE version requirement, you will encounter the following error while starting the program.
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/xmodulo/hmon/gui/NetConf : Unsupported major.minor version 51.0
For example, in this case the program is compiled for Java JRE 1.7 but the system only has Java JRE 1.6.
To solve this problem, you need to change the default Java version you are using to Java JRE 1.7 or higher (assuming that such JRE is already installed).
First, check available Java versions on your Linux system by using update-alternatives command:
If the necessary Java JRE is not installed, you can always install it using .
Now that there are suitable candidates to change to, you can switch the default Java version among available Java JREs by running the following command:
When prompted, select the Java version you would like to use. In this example, we choose Oracle Java JRE 1.7.
Now you can verify the default Java version as follows.
Finally, if you defined JAVA_HOME environment variable somewhere, update the variable according to the newly set default Java version.