2

I'm working on OS X Mavericks 10.9.5. I already have installed a jdk 1.6 on my OSX. I'm trying to install java 1.8 jre for using the latest version of Eclipse. I simply went on the oracle website and got the dmg.

It installed OK, no errors.

Yet, the latest version of Eclipse keeps using the old one. Same story from terminal java -version returned java version "1.6.0_65" and which java returned /usr/bin/java that was a link to /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java so I removed the link and recreated one to /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java that appears to be java version "1.8.0_40".

At this point eclipse returns an error:

The JVM shared library "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/../lib/server/libjvm.dylib"
does not contain the JNI_CreateJavaVM symbol.

which is not accuate at all, since a simple

grep JNI_CreateJavaVM /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/../lib/server/libjvm.dylib

returns

Binary file /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/server/libjvm.dylib matches

I also tried to add that path to info.plist in the Eclipse.app directory, but nothing works at this point and I'm out of options...

Any suggestions?

jww
  • 97,681
  • 90
  • 411
  • 885
frakie
  • 21
  • 1
  • 2
  • This question appears to belong on another site in the Stack Exchange network because its not about programming or development. Perhaps you should try [Super User](http://superuser.com/) or [Apple Stack Exchange](http://apple.stackexchange.com/). – jww Mar 13 '15 at 00:00
  • 2
    @jww isn't setting up a development environment on topic here? Or has it become off topic at some point? Frakie: what about using the -vm argument for the eclipse command if the VM is not installed as the default VM? – Maarten Bodewes Mar 13 '15 at 00:13
  • @ Maarten - there's really no question (other than "Any suggestions?"). The problem statement seems to concern itself with configuring Java with OS X. I don't believe that's on topic because it does not directly relate to programming and development. That is, it does not pass the sniff test from 10,000 feet. The other school of thought is "nearly everything relates to what a programmer does, so everything is on topic". In that case, we should merge with Super User ;) – jww Mar 13 '15 at 00:22
  • Install the 1.8 JDK rather than the JRE (from http://www.oracle.com/technetwork/java/javase/downloads/index.html) – greg-449 Mar 13 '15 at 07:47
  • @jww: I've actually found a number of similar questions on stackoverflow, this [http://stackoverflow.com/questions/14105575/eclipse-on-mac-10-8-installed-1-7-0-jre-jdk-but-eclipse-wont-launch] is an example, but really there is quite a large number, and not finding an answer to my issue in those, I opened this one. Maarten: Thanks I'll try greg-449: as you can read in the title and below, I've already tried with no success. – frakie Mar 13 '15 at 14:01
  • @MaartenBodewes: Your first comment helped me launch eclipse (using -vm), maybe adding this as an answer would be helpful for others? The existing answer doesn't really have a solution. – newenglander Sep 10 '15 at 16:20

2 Answers2

7

I think the issue is with the link. /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java links to the java Plugin for safari, which is different from the regular version of java.

When you changed the link, you changed the link from a valid jvm to a plugin.

java -version returns the default version of java, which on Macs, is jdk 6, and comes with your mac. To get the location of all versions of java, run /usr/libexec/java_home, which on my mac, leads to /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home.

Another way to list all Java installations is by opening the Java Control Panel, which should be openable from System Preferences.

Hope this helps!

0az
  • 350
  • 7
  • 18
1

You can use the -vm switch to point out any Java VM executable: bin/java under Unix and bin\javaw.exe. It will then automatically use the path to the executable (up to bin) as base for the VM that Eclipse runs under. Note that you may still have to set the preferences and/or project settings (type JRE in the project properties or configuration window) to the same - or any other JRE - as well.

Maarten Bodewes
  • 90,524
  • 13
  • 150
  • 263