shmoolki shmoolki - 29 days ago 7
Java Question

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!

Answer Source

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!