shmoolki
shmoolki

Reputation: 1561

Update java in mac for eclipse installation

I want to install Eclipse in my Mac (Yosemite OS Installed). But there is an error popup : Error Popup

I Check my java configuration and i have 1.7 instaled.

Java installation

I made the update in System preference > Java

And i know that i have the installation of JAva 8 in my computer because when i type in my terminal this command:

/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version

I have java 1.8

But in my Os use the version 1.7 and not 1.8 what i have to do? And why it is so difficult to do that, why it is not enough to update via System > Preferences

Thanks for you Help!

Upvotes: 2

Views: 2765

Answers (4)

biblicalPH
biblicalPH

Reputation: 91

  1. Install homebrew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" See Homebrew homepage here

  2. Install java using homebrew a. brew update b. brew tap caskroom/cask c. brew install brew-cask d. brew cask install java See full instructions at (tomysmile/brew-java-and-jenv.md)[https://gist.github.com/tomysmile/a9a7aee85ff73454bd57e198ad90e614]

  3. Install jenv, a java environment manager brew install jenv

  4. Add jenv to your path - see jenv page above

  5. Add java path using jenv jenv add /Library/Java/JavaVirtualMachines/your-jdk-version/Contents/Home Replace your-jdk-version with the version of jdk you have installed on your system

  6. Restart eclipse and that's it

Upvotes: 1

shmoolki
shmoolki

Reputation: 1561

I made this via homebrew and it work for me:

 brew update
 brew cask install java

It is now installed in java_home like the version 1.7

enter first version instaled here

But until the first version is in use.

Now You just have to export to JAVA_HOME variable with this command:

export JAVA_HOME=`/usr/libexec/java_home -v '1.8*'`

And it work

Thanks!

Upvotes: 3

Rodrigo
Rodrigo

Reputation: 517

Try this on a terminal window

echo $JAVA_HOME

you might get something like /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home (<-- that's mine, java 8)

Yours might point to Java 7. You can change JAVA_HOME to point to your Java 8 installation by doing

export JAVA_HOME=<path-to-java8-installation>

And then it should work.

(btw: your installation dir for Java 8 looks rather odd. you might want to re-install so that it is on a path that looks like mine above)

Upvotes: 1

greg-449
greg-449

Reputation: 111217

The JavaAppletPlugin.plugin Java is just the JRE, you need the full JDK to run Eclipse (and other Java applications) on a Mac.

So download and install the Java 8 JDK from the official Oracle site

Upvotes: 1

Related Questions