简体   繁体   中英

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)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM