Search code examples
javamacosmacos-sonoma

How do I install Java 6 on Mac OSX 14.3.1 when I already have other versions of Java installed?


I need to install Java 6 on a Mac running OSX 14.3.1 (Sonoma) for one work project.

Oracle doesn't have a Java 6 download for Mac.

The Apple Support installer won't install Java 6 if I have other versions of Java installed (I have 11, 13 and 17).

I don't want to uninstall the other versions of Java, I will need them for parallel work projects.

I suppose I can move / delete / uninstall the newer versions, install Java 6, and then reinstall / move back the newer versions, but I have concerns that this may fail.

Has anyone managed to do this? What worked for you?


Solution

  • I think you should use Cast feature:

    brew tap homebrew/cask-versions
    brew cask install java6
    

    Or from Captain Chaos comment:

    brew tap homebrew/cask-versions
    brew install java6
    

    This will install Java 6 on your system without interfering with the other Java versions.

    Note that to manage your Java version configurations appropriately using tools like java_home or setting the JAVA_HOME environment variable.