How to start Eclipse using Oracle 1.7 JDK for Mac?

I am trying to get the new 1.7 JDK working with Eclipse (this is the official release of Oracle).

I don’t want to just point Eclipse to it so that you can use it in projects, this works great, but actually makes Eclipse work using the 1.7 JVM.

I moved the new JVM to the top of the list in Java Preferences, but Eclipse still starts with 1.6. If I disable 1.6 in the Java settings, I get a dialog right after I double-clicked Eclipse, saying "Failed to create Java virtual machine."

edit: I added the following to my eclipse.ini just before -vmargs:

-vm /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/bin/java 

In the details dialog for installing Eclipse, I still see:

 java.runtime.version=1.6.0_31-b04-415-11M3646 

edit 2: here is the contents of my eclipse.ini file: https://gist.github.com/2512578

+46
java eclipse macos
Apr 27 2018-12-12T00:
source share
15 answers

I just added my comment to https://bugs.eclipse.org/bugs/show_bug.cgi?id=339788 regarding the inability to use the new JDK for Oracle with Eclipse in OS X. Using the -vm option inside eclipse.ini does not work. The only way I came across is to use the following shell script:

 #!/bin/sh # export JAVA_HOME=/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home LAUNCHER_JAR=/Applications/eclipse/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar java \ -showversion \ -XX:MaxPermSize=256m \ -Xms1024m \ -Xmx1024m \ -Xdock:icon=/Applications/eclipse/Eclipse.app/Contents/Resources/Eclipse.icns \ -XstartOnFirstThread \ -Dorg.eclipse.swt.internal.carbon.smallFonts \ -Dosgi.requiredJavaVersion=1.5 \ -jar $LAUNCHER_JAR 

Using the steps of http://mathiasbynens.be/notes/shell-script-mac-apps , I turned the script into an application that I can store on the dock.

+32
Apr 29 '12 at 18:42
source share

There is another way. Add two more lines before -vmargs in the .ini file:

 -vm {YOUR_JAVA_7_HOME}/jre/lib/server/libjvm.dylib 

(remember that these must be separate lines), and also add the corresponding entry to the file "Info.plist" (add or change the elements of the array in the "Eclipse" section - each child element of the line corresponds to a command line parameter).

 ... <key>Eclipse</key> <array> <string>-vm</string> <string>/{MY_VM_HOME}/jre/lib/server/libjvm.dylib</string> ... </array> 

Alternatively, simply use the -vm {YOUR_JAVA_7_HOME}/lib/server/libjvm.dylib command-line -vm {YOUR_JAVA_7_HOME}/lib/server/libjvm.dylib when starting eclipse from the terminal.

+36
Feb 08 '13 at
source share

There seems to be a fix for Kepler that should appear in the next release of the service.

Meanwhile, there is a workaround mentioned in this error that will allow you to run eclipse without installing JRE 1.6 on Apple: https://bugs.eclipse.org/bugs/show_bug.cgi?id=411361#c20

This will allow you to launch an eclipse from a finder or spotlight, but not a dock.

I just tested this on OS X Mavericks, which during the upgrade loses jre 6 and asks to install it when you try to run Eclipse. Of course I have the latest Oracle JDK 1.7.

Give it up, and then to get around it, edit the jvm features in / Library / Java / JavaVirtualMachines / jdk 1.7.0_45.jdk / Contents / Info.plist

 <key>JVMCapabilities</key> <array> <string>CommandLine</string> <string>JNI</string> <string>BundledApp</string> <string>WebStart</string> <string>Applets</string> </array> 

With this fix, you do not need to specify vm in eclipse.ini.

+9
Oct 26 '13 at
source share

On the Mac above, it does not seem to work. For me, with Eclipse KEPLER, it worked by adding

 -vm /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/ 

at the end of my eclipse.ini (without this line)

This finally changed my Eclipse Installation Details> Configuration from

-vm / System / Library / Frameworks / JavaVM.framework

to

-vm / Library / Java / JavaVirtualMachines / jdk1.7.0_45.jdk / Contents / Home / bin /../ jre / lib / server / libjvm.dylib

This helped not work with my Eclipse INDIGO installation.

+6
Oct 24 '13 at 13:40
source share

After installing the Oracle JRE and JDK, open Info.plist inside Eclipse.app (right-click, show the contents) and paste after "Eclipse" "-vm / System / Library / Frameworks / JavaVM.framework / JavaVM"

My looks like this:

  <key>Eclipse</key> <array> <string>-vm</string><string>/System/Library/Frameworks/JavaVM.framework/JavaVM</string> <string>-keyring</string><string>~/.eclipse_keyring</string> <string>-showlocation</string> </array> 

If you do this, you will not have to update the file after updating the JRE.

+3
Dec 16 '13 at 10:59
source share

Just edit

 Eclipse.app/Contents/Info.plist 

You must use a specific version of Java (instead of the default platform) uncomment one of the following options:

 <string>-vm</string> <string>/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java</string> 

This helped me rollback from 1.7.0 to 1.6.0.

+2
Nov 05 '13 at 11:35
source share

Verify that your java_home is corrento in / usr / libexec / java _home;

Do not change your eclipse.ini and edit the Info.plist file and change / add this line <string> -vm </ String> <string> / Library / Java / JavaVirtualMachines / 'JDK-version-yours / Contents / Main / bin / Java </ line> and save. Open Eclipse and Finish!

This worked for me, and use javafx e (fx) clipse!

PS: On Mac OS X, you can find Info.plist by right-clicking (or Ctrl + clicking) in the Eclipse executable in Finder, select β€œShow Package Contents”, and then find Info.plist in the β€œContent” folder.

+2
Feb 16 '14 at 17:47
source share

Assuming you are using a version of Eclipse that supports Java 7 (I believe all are 3.7 and higher), you should specify the JVM used by Eclipse in the eclipse.ini file. If you open it, you will see the β€œ-vm” property, followed by the JVM directory that you are currently using. You should simply change this directory to your 1.7 installation.

Note. I have not used Eclipse on a Mac, so the configuration file name may be different.

+1
Apr 27 2018-12-12T00:
source share

Starting from 2012-04-28, this is a known unresolved error in the Eclipse 3.7 SR2 launcher application.

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=339788

+1
Apr 28 '12 at 18:24
source share

I had this problem. I fixed it by downgrading and downloading JDK 7.

+1
Jul 04 '15 at 5:59
source share

I had a similar problem after downloading and installing Titanium. My eclipse worked, but Titanium didn’t, and so I ended the search in the configuration file to see what was different

Eclipse had

 eclipse.p2.profile=epp.package.standard 

Titanium had

 eclipse.p2.profile=profile 

After changing above, to match eclipse configuration, I was able to run Titanium

0
Nov 13 '13 at 20:06
source share

This resolved for me in a few clicks. GoTo Eclipse - > Preference - > Java - > Installed JRE - > Add button - > Standard VM and go to the JRE Home homepage to /Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home and add your own name. After specifying the JRE path, the required Jar files will be automatically added and click Finish. Make sure jdk is already installed.

0
May 06 '14 at 11:05
source share

For me, this worked the fix suggested at https://bugs.eclipse.org/bugs/show_bug.cgi?id=411361#c25 :

 #!/bin/bash # Workaround for https://bugs.eclipse.org/411361 # "[Mac] Kepler doesn't launch without JRE 6, even if JDK 7 is installed" # # Put this launch.command into the same folder as Eclipse.app. # # If necessary, adapt JAVA_EXECUTABLE to the full path to your Java executable: JAVA_EXECUTABLE=java cd "$(dirname "$0")" $JAVA_EXECUTABLE \ -Djava.library.path="$(echo plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_*/eclipse_*.so)" \ -Xms512m \ -Xmx2048m \ -Xdock:icon=Eclipse.app/Contents/Resources/Eclipse.icns \ -XstartOnFirstThread \ -Dorg.eclipse.swt.internal.carbon.smallFonts \ -XX:MaxPermSize=256m \ -jar "$(echo plugins/org.eclipse.equinox.launcher_*.jar)" \ -os macosx \ -ws cocoa \ -arch x86_64 \ -showsplash \ -name Eclipse \ --launcher.appendVmargs \ -debug \ -showlocation \ -consolelog 
0
Sep 05 '14 at 8:39
source share

By default, your MacOSX ships with JRE 1.6.0, which is not suitable for Eclipse. To solve the problem, you also need to install JDK 7, which already includes JRE 1.7.0.

Here is the link you can download.

Just select the version of MacOS X under the Java SE Development Kit 7u79 and install it.

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

After installing this package, Eclipse will start without any changes.

0
Jul 02 '15 at 9:46
source share

a simple solution. to another thread here. download Java from apple.com instead of Oracle. He completely fixed the problem and now opens with a double click, no terminals or programming required.

-one
Apr 18 '14 at 10:22
source share



All Articles