aspose file tools*
The moose likes Java in General and the fly likes Updating Java on Mac - despite updating java -version still = 1.6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Updating Java on Mac - despite updating java -version still = 1.6" Watch "Updating Java on Mac - despite updating java -version still = 1.6" New topic
Author

Updating Java on Mac - despite updating java -version still = 1.6

Alvin Watkins
Ranch Hand

Joined: May 25, 2011
Posts: 53
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.

Thanks for your help.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61661
    
  67

I can't directly help you because all my clients have no plans to update to Java 7 in the near future, so neither have I.

But I assume you have seen this FAQ? I'm posting it just in case you haven't (or someone else hasn't).


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Alvin Watkins
Ranch Hand

Joined: May 25, 2011
Posts: 53
Thank you, Bear.

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.

Ivan Jozsef Balazs
Rancher

Joined: May 22, 2012
Posts: 877
    
    5
> 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
file /usr/bin/java
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


Alvin Watkins
Ranch Hand

Joined: May 25, 2011
Posts: 53
Thank you Ivan.
Ivan Jozsef Balazs
Rancher

Joined: May 22, 2012
Posts: 877
    
    5
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Updating Java on Mac - despite updating java -version still = 1.6