Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting JAVA_HOME in Mac OS X

 
Joe Harry
Ranch Hand
Posts: 10122
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Joe Harry
Ranch Hand
Posts: 10122
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10122
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got this fixed!



did the trick!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34401
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I gave you a cow for fixing the problem "in the middle of the night" by yourself and sharing the solution.
 
Joe Harry
Ranch Hand
Posts: 10122
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Joe Harry
Ranch Hand
Posts: 10122
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bumping on my very own thread. I just installed Java 8 on my Mac and tried to export the path in my .bash_profile. But now I'm not able to find out which version is installed as I see the following on starting up a terminal:

Unable to find any JVMs matching version "1.8.0_60".


I installed jre-8u60-macosx-x64.dmg on my Mac. What would this be as a version number that I can export as JAVA_HOME?
 
Joe Harry
Ranch Hand
Posts: 10122
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok I got this fixed! I had to download the JDK and not just the JRE:

http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
 
Joe Harry
Ranch Hand
Posts: 10122
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another cow perhaps?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic