I have been trying to figure out the best way to run OpenJDK Java Runtime as default Java for my Fedora box and use Oracle JDK 6 for Android development namely for running Android SDK Manager, Android Studio and Eclipse from Android Bundle.
I installed OpenJDK Java Runtime from the Fedora repository which has setup alternatives as follow.
[donnie@fedora ~]$ alternatives --list | grep java
jre_openjdk auto /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.5.1.fc20.x86_64/jre
jre_1.7.0 auto /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.5.1.fc20.x86_64/jre
java auto /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.5.1.fc20.x86_64/jre/bin/java
libjavaplugin.so.x86_64 auto /usr/lib64/IcedTeaPlugin.so
I have installed the Oracle JDK 6 using the rpm provided by Oracle.
I could make Android Bundle and Studio make use of JAVA_HOME to run under Oracle JDK by sticking following in .bashrc
.
export JAVA_HOME=/usr/java/jdk1.6.0_45/
export PATH=$JAVA_HOME/bin:$PATH
I noticed that Chrome still uses OpenJDK (as I still need to link the plugin).
What are the difference between JAVA_HOME and using alternatives?