6
  • When I look at System Preferences > Java > Update, I see

    Your system has the recommended version of Java.
    Java 7 Update 79

  • From Terminal, java -version:

    java version "1.7.0_71"
    Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
    Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

  • From Terminal, export:

    JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home"

  • In addition to that, I also have the Java from Apple/Oracle installed as well (when first prompted to install when opening a Java-based app when there's no Java yet installed)

Questions:

  1. Is Java 7 Update 79 == jdk1.7.0._71.jdk? Or are these separate?
  2. When running some thing with Java, there is always the following:

    objc[63077]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.

I'd be more than willing starting from scratch had I understood the steps to do that properly (remove, re-install). If it matters, am running OS X 10.10.

Idan Adar
  • 163

2 Answers2

3

System Preferences shows the Java used for web applets and java -version the one found by /usr/bin/java

To get the latter install the JDK not the JRE

mmmmmm
  • 30,160
1

The following generally works for Java, versions 8 through 17.

brew install java may not be the best way to install Java.

Java JDK should be unzipped into a folder identifying it, withing /Library/Java/JavaVirtualMachines . I usually either manually download JDK and unzip it into the above folder OR install it via jenv command. The former gives you more control.

Then you should have jenv installed and have this in your .bash_profile :

export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"

Don't install Java with brew . Instead: brew install jenv . Then, install Java (OR link to your installed java) using jenv.

djangofan
  • 255