change java version on mac

This is taken from a conversation over at javaranch. Decided to note down just the essentials of what to do in Terminal if you need to change the version of java that you’re working with:

  • Change the current directory by typing: cd /System/Library/Frameworks/JavaVM.framework/Versions
  • Within this directory, there is an alias called CurrentJDK pointing to the “current” version of Java. You need to remove this alias by typing: rm CurrentJDK
  • Now you need to replace it with a new alias pointing to the 1.5.0 directory instead. Do this by typing: ln –s 1.5.0 CurrentJDK

Thanks Marc. 🙂

This entry was posted in tech notes and tools and tagged , , . Bookmark the permalink.

2 Responses to change java version on mac

  1. Martin says:

    But how to make a new alias, if I don’t even can install java 1.5?

  2. noah little says:

    I can’t remember if I had to install 1.5 or if it was already on my machine when I got it. I’m running 10.4.11 (Tiger) now, it was delivered with an earlier verson of OS 10.4.

    Without knowing exactly what the problem is, I’m not sure I can help. Would need to know what you’ve tried already and what happened (more details about why you can’t install java 1.5).

    If you’re running 10.4.2 or later, this article should help you to get the download and do the install.

Comments are closed.