I created a program in java using a tutorial from NetBeans, and it works great in Windows. However, when I attempt to run the same .jar
in Linux (RedHat) I get the following exception:
Exception in thread "main" java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=my/numberaddition/NumberAdditionUI, offset=6
From running this command:
java -jar NumberAddition.jar
The output ends with:
Could not find the main class: my.numberaddition.NumberAdditionUI. Program will exit.
The source code for this example can be found here. What am I missing?
Edit: Is there something I need to add for portability between operating systems?
Edit, answer: Thanks for the commenters who left possible duplicate links. From those and some further research I was able to determine that the JRE on the Linux environment was an older version (1.6) than the version I compiled the program in originally (1.7).