aspose file tools*
The moose likes Mac OS and the fly likes Setting JAVA_HOME in Mac OS X Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Mac OS
Bookmark "Setting JAVA_HOME in Mac OS X" Watch "Setting JAVA_HOME in Mac OS X" New topic
Author

Setting JAVA_HOME in Mac OS X

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9384
    
    2

I have exported the following line to my .bash_profile:

export JAVA_HOME=$(/usr/libexec/java_home)


When I run:



I see the following:


Doing a java -version returns the following:



How can I force JAVA_HOME to point to JDK 7?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9384
    
    2

One step closer to what I want:



I now have multiple JDK 7. How do I force it to use 1.7_x in my case?
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9384
    
    2

Got this fixed!



did the trick!
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30545
    
150

I gave you a cow for fixing the problem "in the middle of the night" by yourself and sharing the solution.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9384
    
    2

Jeanne Boyarsky wrote:I gave you a cow for fixing the problem "in the middle of the night" by yourself and sharing the solution.


I will milk that cow now! Thanks!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Setting JAVA_HOME in Mac OS X