Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
student:java:jar [2019/01/31 14:15] – bernstdh | student:java:jar [2022/09/04 08:47] – bernstdh | ||
---|---|---|---|
Line 55: | Line 55: | ||
==== Testing an Executable .jar File ==== | ==== Testing an Executable .jar File ==== | ||
+ | If you just click/ | ||
- | If you just click/ | + | | |
+ | If you get a message like the following: | ||
+ | < | ||
+ | Exception in thread " | ||
+ | The program has been compiled by a more recent version of the Java Runtime (class file version XX.0), | ||
+ | this version of the Java Runtime only recognizes class file versions up to YY.0 | ||
+ | </ | ||
- | | java -jar // | + | it means that you need to update your version of Java. When doing so, you need to be careful because many systems have both the Java Runtime Environment (JRE) and the Java Development Kit (JDK) installed, and updating the one may not update the other. In Linux/OSX you can use %% which java%% and in MS-WIndows you can use %%where java%% to find the path to the Java interpreter. You can change the %%path%% environment variable (not the %%classpath%% environment variable) to change which Java interpreter is used (i.e., either the one installed with the JRE or the one installed with the JDK). |
- | + | ||
==== Using Resources in a .jar File ==== | ==== Using Resources in a .jar File ==== |