Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the source of the discrepancy in Java versions: Java 6 (in Terminal, Eclipse) and Java 7 (in Java Control panel)?

Eclipse complains: JRE version is 1.6.0; version 1.7.0 or later is needed to run Google Plugin for Eclipse.

Eclipse and JRE

In the Terminal, java concurs:

> java -version
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)

But in System Preferences \ Java \ the Java Control Panel says Your system has the recommended version of Java: Java 7 Update 51

Java Control Panel

and points to /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java.

SystemPrefs

Eclipse preferences show that the installed JRE is at: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

EclipsePrefs

To point Eclipse to Java 7 (1.7.0), it's enough to change the preference:

New Java version to Eclipse

What is the source of the discrepancy in Java versions? Is this an instance of having different PATHs between the command-line Mac and the windowed-Mac?

Edit

If I edit /usr/local/adt-bundle-mac-x86_64/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini by adding

-vm
"/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java"

Eclipse refuses to start.

JRE-or-JDK-must-be-available

And yet this is indeed 1.7:

> "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
like image 947
Calaf Avatar asked Feb 05 '14 22:02

Calaf


1 Answers

If you want to be certain of the JVM that is used to run Eclipse, you need to specify it in your eclipse.ini file, according to these instructions.

like image 150
E-Riz Avatar answered Oct 17 '22 07:10

E-Riz