2

In relation to this question ... the solutions offered don't work for me. First, folder /Library/Java/Extensions is empty and ~/Library/Java folder does not exist on my OS X Yosemite 10.10.1 system.

I did do a Java update to 1.8 from the Oracle site, and got this part to work: java -version returns: java version "1.8.0_31" Java(TM) SE Runtime Environment (build 1.8.0_31-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode), but
javac -version returns a no program found error: Unable to locate an executable at "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/javac" (-1)

The directory /Library/Java/JavaVirtualMachines/ is also empty.

Lastly, if I do: /usr/libexec/java_home -v 1.8.0_31 --exec javac -version Unable to find any JVMs matching version "1.8.0_31". javac 1.6.0_65 Notice how --exec javac -version in the previous one-liner does find the javac, but it reports the old 1.6. How do I fix my paths so that javac works? Here is my PATH and JAVA_HOME:

mbp_host$ echo $JAVA_HOME returns

/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home

mbp_host$ echo $PATH returns

/usr/local/homebrew/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin

Community
  • 1
  • 1
sAguinaga
  • 638
  • 13
  • 31
  • Check out this solution I posted in [Apple Support Communities](https://discussions.apple.com/thread/6808987). – sAguinaga Apr 04 '15 at 10:13

1 Answers1

0

This is more of a work around than solution. Mac just always seems to point to this location despite updates to path, java_home :

enter image description here

After installing java8 from Oracle to compile I explicitly point to the compiler : /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/javac MyClass.java

blue-sky
  • 51,962
  • 152
  • 427
  • 752