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-184.108.40.206-220.127.116.11.fc20.x86_64/jre jre_1.7.0 auto /usr/lib/jvm/java-1.7.0-openjdk-18.104.22.168-22.214.171.124.fc20.x86_64/jre java auto /usr/lib/jvm/java-1.7.0-openjdk-126.96.36.199-188.8.131.52.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
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?