By default Fedora 12 doesn’t install Sun’s Java, and it isn’t in the repository. This isn’t a mistake, in fact I think this is a good decision! Fedora is only dealing with free open source software. You can add other repositories to give you the extra non OSS software you want, for those who cannot live without certain software.
Fedora uses the OpenJDK, which I think is awesome.. but unfortunately as I am a Java developer at the moment, and it seems some of the software I work requires the Sun version of Java, at least to compile.
So I needed to install Sun JDK on my 64bit machine.. this is how I did it:
- Download the Sun Java JDK 64bit Linux bin installer.
- Run it to install.
- Even though I ran it as root it installed in the current folder. So move the folder to we it should be installed:
sudo cp -a jdk1.6.0_16 /usr/lib/jvm/
- Use the alternatives command to tell Fedora to use the new Java binary, to do so we need to “install” the new binary as an option in alternatives:
sudo /usr/sbin/alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_16/bin/java 20000
Then use alternatives and make sure our new binary is selected:
sudo /usr/sbin/alternatives --config java
- Use the following command to verify that Fedora is pointing to the right binary:
That’s it, Sun’s Java should now be installed!