Terminal Error with Java Runtime, can't recognize class file versions > 52.0

524 Views Asked by At

I'm trying to run this applet (compiled in a way that the class file version is 54.0) in Linux from Terminal, and although I installed the latest version of java, it's version it's stuck to 1.8.0_181, with its Java(TM) SE Runtime Enviroment (build 1.8.0_181-b13).

With some research I managed to find out that I need to set the JRE to java 10 to run it, but I never found the answer that I needed, the steps. Many suggested Eclipse, but install it just to run an applet seems overkill to me, what can I do to set java up in a way that I can run this applet (whose class file is up to 54)?

p.s. I'm gonna be honest what I need are the STEPS to get me there.

2

There are 2 best solutions below

8
Joni On

The current latest version of Java is 14. If you have Java 1.8, it's not the latest version.

If the package repositories for your Linux distribution don't include the latest version of Java, you can install it from:

7
Stephen C On

On Linux you can:

  • Run commands Java commands by giving the absolute path for the command.
  • Change the PATH environment variable so that the directory containing the Java executables is on the command path (in front of "/usr/bin" which is where the default Java commands will appear)
  • Use the alternatives tools to change what (for example) appletviewer refers to.

Note that Java 10 is the last version that will support appletviewer. Applets were deprecated in Java 8, and much of the applet support infrastructure was removed in Java 11; see Will it be possible to run Java applets with Java JRE 11?.