| Summary: | Launcher doesn't work with OpenJDK Java 7 on Mac OS X | ||
|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | James Blackburn <jamesblackburn+eclipse> |
| Component: | Launcher | Assignee: | Silenio Quarti <Silenio_Quarti> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | alessio.pollero, alex.tugarev, aniefer, apeeters, brett.wooldridge, campbellbd, channingwalton, david_williams, dmz, eclipse.dserodio, ian.clarke, jkwuc89, jngcourson, kiniry, konrad_w, malaperle, manderse, mlippert, overholt, pwebster, remy.suen, richard.eckart, romain.bioteau, Silenio_Quarti, swingler, tonyb452, uwe, youngm |
| Version: | 3.7 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
James Blackburn
IIRC, the launcher only falls back to a separate JVM process on Linux x86_64 but not on x86. I had thought that bug 276763 included changes on mac to fork the vm in a separate process, however looking at the source, we still always use JNI on mac. bug 288408 is somewhat related Tried the launch with the just released JDK 1.7 Developer Preview for Mac OSX, but the issue remains the same... According to https://wikis.oracle.com/display/OpenJDK/Mac+OS+X+Port+Project+Status -> Non-Features JNI instantiation through the JavaVM.framework will not be possible. As a workaround it is recommended to embed your own JRE instead. Also see http://java.net/jira/browse/MACOSX_PORT-98 (In reply to comment #4) > According to > https://wikis.oracle.com/display/OpenJDK/Mac+OS+X+Port+Project+Status -> > Non-Features JNI instantiation through the JavaVM.framework will not be > possible. > As a workaround it is recommended to embed your own JRE instead. > > Also see http://java.net/jira/browse/MACOSX_PORT-98 This seems not quite correct. There is no need to embed a JRE: Apps which choose to instantiate Java via JNI, can directly link against the bundle's primary executable, or load the .jdk or .jre via CFBundleCreate(), and access the JNI entry points with CFBundleGetFunctionPointerForName(). Eclipse will be expected to embed it's own JRE/JDK to be as widely deliverable as possible, and to produce apps that also contain an embedded JRE/JDK. While it may be possible to detect .jdk bundles that may or may not be on the system, the fallback case of forcing the user to install a 3rd-party component is an unacceptable user experience, and cuts off some significant avenues of distribution. (In reply to comment #6) ... Mike Swingler, I agree that eclipse should probably support having an embedded JRE/JDK however, I otherwise respectfully disagree. Embedding the JRE/JDK is not the proper solution to this problem. First, much of the Eclipse user community are developers who are not averse to installing the JDK separately. Second, any app that wants to share the central JRE/JDK installation will need to detect it's existence, that's the standard modus operandi. If we want to avoid detecting java then we are saying that anything that needs to run on java will need to embed the JRE - nope, for various reasons. Third, many Eclipse users will need to have access to multiple JDK versions anyway to be able to target and test against. I like the way that I can select the default Java JRE with the OS X Java configuration tool - having a central default JRE/JDK is good. Eclipse should honor that. At the same time, Eclipse should honor the -vm option in its eclipse.ini (or if necessary in the Info.plist), like on all other platforms, because at times I want to try a different runtime without switching the system default. Again, its good to have a central system-wide place where these other runtimes are kept. This issue also occurs when attempting to start Eclipse 3.7 using the recently released Oracle JDK for OS X. On my MacBook Pro, I installed the Oracle JDK. I then opened Java Preferences and made the Oracle JDK the default and disabled the other available JVMs. When I attempt to start Eclipse, I get an alert box that states, "Failed to create the Java Virtual Machine". Adding -vm /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/bin/java to eclipse.ini does not fix this. A discussion of this problem (with the official Oracle 1.7 JDK) and a workaround may be found here: http://stackoverflow.com/questions/10352715/how-do-i-run-eclipse-using-oracles-new-1-7-jdk-for-the-mac/10366339#10366339 (In reply to comment #9) > This issue also occurs when attempting to start Eclipse 3.7 using the recently > released Oracle JDK for OS X. On my MacBook Pro, I installed the Oracle JDK. > I then opened Java Preferences and made the Oracle JDK the default and disabled > the other available JVMs. When I attempt to start Eclipse, I get an alert box > that states, "Failed to create the Java Virtual Machine". Adding -vm > /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/bin/java to > eclipse.ini does not fix this. This has been fixed in 3.8M7. Keith, please could you try 3.8M7 with the recently released Oracle JDK for OS X? The work has been done with an earlier update and I want to make sure it still works. *** This bug has been marked as a duplicate of bug 374791 *** Silenio: http://download.eclipse.org/eclipse/downloads/eclipse3x.html does not contain a download link for 3.8M7. The latest build is 3.8M6. Also, is there 4.2 build that should also contain this fix? 3.8M7 has not been declared yet. It should be done by the end of this week. If you want to try something before, this I-build has the fix: http://download.eclipse.org/eclipse/downloads/drops/I20120430-2000/ One more thing, the latest oracle VM is only 64-bit, so you need the Cocoa/x86_64 build: http://download.eclipse.org/eclipse/downloads/drops/I20120430-2000/download.php?dropFile=eclipse-SDK-I20120430-2000-macosx-cocoa-x86_64.tar.gz Is this really a duplicate of 374791? That's about bundling a JVM, not running Eclipse with an already-installed JVM... Also, the default Java on my Mac is Oracle's 1.7 but by default Eclipse (including 4.2) runs with Apple's 1.6 This is not a strict duplicate, but the fix for bug#374791 fixed this problem as well. Is your Eclipse 32 bit or 64 bit? The 32 bit Eclipse will not run on the Oracle's JDK because this VM only supports 64 bit. I also have this problem with Lion 10.7.4, Eclipse JEE 4.2 (64-bit) and Java 1.7.0_05 being selected as first choice on my system. Still Eclipse uses Java 6. (In reply to comment #16) > This is not a strict duplicate, but the fix for bug#374791 fixed this problem > as well. > > Is your Eclipse 32 bit or 64 bit? The 32 bit Eclipse will not run on the > Oracle's JDK because this VM only supports 64 bit. Eclipse is 64 bit, from the eclipse-jee-juno-macosx-cocoa-x86_64.tar.gz package, and I'm on OS X 10.7.4. I've added the following lines to eclipse.ini, right before the -vmargs line: -vm /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home Should I comment on bug#374791 instead of here? I am running the classic Eclipse 4.2 on my MacBook Pro with Lion 10.7.4 and my Java Preferences setting is being honored. Specifically, Eclipse 4.2 is using Oracle JDK 7 which I have marked as the only available JDK. Even if I disable all other Java versions except Java 7 in the Java Preferences Eclipse still uses Java 6 for me. That's weird... I reverted my eclipse.ini to the default, disabled the other VMs, leaving only Java 7 enabled in the Java Preferences, then Eclipse used it. Then I closed Eclipse, re-enabled the other VMs (leaving Java 7 at the top, as the default) and it still uses Java 7 as expected. Also, according to Eclipsepedia[1], I had the -vm path wrong (lacking the /bin/java at the end) [1] http://wiki.eclipse.org/Eclipse.ini#-vm_value:_Mac_OS_X_Example |