Tag Archives: java home mac

Locate Java Home on Mac OS

I am using Mac OS X 10.5 and I installed java 7 on it today. But the funny thing was I was unable to locate the directory where I have installed my Java. Finally I found it out and here are the steps :

  1. Make Sure you have Java installed properly. For that open your terminal and type which java. If you have JDK installed your machine, you will get /user/bin/java. This shows that you have JDK and you are safe to search for Java home on your MAC. Otherwise install JDK again on your Mac.
  2. In Mac OS, Java is installed at /Library/Java and your Java home folder should be /Library/Java/home.
  3. If you have multiple versions of JDK installed on same machine, then your Java home could be /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

For checking Java version please type java -version on terminal.

if you are installing Oracle Middleware / Weblogic you may face error : “Invalid Java home
To correct this error, follow these steps:-

1. cd /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
2. sudo mkdir jre
3. cd jre
4. sudo mkdir lib
5. cd lib
6. sudo ln -s ../../../Classes/classes.jar rt.jar

I hope this help. You can make a comment if you need any help from me.