0

The Java Control Panel says I have Java 8 update 45. Terminal says: java version "1.7.0_17". Eclipse is using 1.7.0_17-b02. Ho can I switch from Java 1.7 to 1.8 in terminal and Eclipse?

First I tried to make changes in Java Preferences, but is is missing from Utilities. Then I found Installed Java 7 on Mac OS X but Terminal is still using version 6 and have run

sudo rm /usr/bin/java
sudo ln -s /Library/Internet\ PlugIns/JavaAppletPlugin.plugin/Contents/Home/bin/java /usr/bin

Now terminal return java version "1.8.0_45", but Eclipse does not start:

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

Community
  • 1
  • 1
robert
  • 3,539
  • 3
  • 35
  • 56

1 Answers1

0

you need to uninstall jdk 1.7

Navigate to /Library/Java/JavaVirtualMachines and remove the directory whose name matches the following format:

/Library/Java/JavaVirtualMachines/jdkmajor.minor.macro[_update].jdk

For example, to uninstall 8u6:

% rm -rf jdk1.8.0_06.jdk
Grbe1l
  • 489
  • 4
  • 16