Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should I upgrade my Java compiler

When I run $ javac Simulator.java then I get the following warning:

warning: ./particle_simulator/Atom.class: major version 51 is newer than 50, the highest major version supported by this compiler.

I don't know why I suddenly get this warning as I haven't made substantial changes to my code. Nevertheless, how do I upgrade my Java compiler?

I'm running Mac OSX 10.7.5 and my Java version is below:

java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
like image 367
Eric Baldwin Avatar asked Nov 22 '13 05:11

Eric Baldwin


People also ask

How do I Update my version of Java?

Go to the Windows Start Button and select Settings then Control Panel. Click Java in the Control Panel list, it has an icon of a coffee cup with steam. Select the Update tab then click the Update Now button. Click Yes to allow changes.

What is the latest version of Java compiler?

Java 19 and Java 17 available nowJava 17 LTS is the latest long-term support release for the Java SE platform.


1 Answers

Download the JDK from Oracle: http://www.oracle.com/technetwork/java/javase/downloads/ . Make sure you get the OSX version. It has its own installer so installation should be pretty straight forward.

like image 99
Asaph Avatar answered Sep 28 '22 08:09

Asaph