I am sure this is a very simple issue but I'm not versed in Mac and am having some issues updating Java.
I am debugging an application that is having troubles on Mac. The first step I'd like to take is to update from Java 6 to Java 7 and see if that helps fix the bug. I followed the instructions Oracle gives for updating to Java 7 (which is pretty much to just download and install and all should be good to go). I downloaded Java 7, installed it and visited the panel via System Preferences. Yet, when I open a terminal and type "java -version" I get 1.6. I used command "which java" (just guessing from my use of Linux) and got /usr/bin/java. How do I actually update the Mac's settings to point to the latest Java 7 I installed? I am using OS X 10.8.2.
Yes. I followed those directions. They are the ones that say all you have to do is download and install and you'll be good to go. In my case, it did not change the JRE. It just added Java to the System Preferences app. When I open a terminal and type java -version it still says 1.6.
> I used command "which java" (just guessing from my use of Linux) and got /usr/bin/java
The Linux analogy would further suggest to use
to see whether it is a real file or a (sym or hard) link. In the latter case you could tweak it to point to the new java.
Provided it is available and you were able to locate it.
find / -name java
Joined: May 25, 2011
Thank you Ivan.
Ivan Jozsef Balazs
Joined: May 22, 2012
I write version-dependent wrappers for the JDK commands like java15 or javac16 or javap17 etc. and put them to a directory on the PATH.
These wrapping scripts call the corresponding executables using the absolute path names forwarding all arguments.
So a peaceful coexistence of several different Java versions is achieved.