Ubuntu and openSuse both come with openJDK installed, however at times one needs Oracle JDK to be present in the system. Here are the steps needed to install it on both OS.
1. Download Oracle JDK fron oracle site Download Oracle JDK. These instrction are for
Java SE 6 Update 35.
2. Copy it to "/usr/lib/jvm" directory
# cp jdk-6u35-linux-i586.bin /usr/lib/jvm3. Make it executable and run it
# chmod +x jdk-6u35-linux-i586.bin
# ./jdk-6u35-linux-i586.binIt shall unzip itself and create directories.
4. Install it in alternatives system
# sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_35/bin/java 1
# sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_35/bin/javac 1
# sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_35/bin/javaws 1Here is what update-alternatives' man page says about installing
update-alternatives --install <link> <name> <path> <priority>
5. Now select it as default by running these commands and select the JDK
# sudo update-alternatives --config java
# sudo update-alternatives --config javac
# sudo update-alternatives --config javaws6. Create plugin link
# sudo ln -s /usr/lib/jvm/jdk1.6.0_35/jre/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins7. Now test it with version
# java -version
java version "1.6.0_35"
Java(TM) SE Runtime Environment (build 1.6.0_35-b10)
Java HotSpot(TM) Client VM (build 20.10-b01, mixed mode, sharing)
For openSuse all above is same except these enviornment variables needs to be put in "/etc/profile"
export JAVA_HOME=//usr/lib/jvm/jdk1.6.0_35/
export JAVA_BINDIR=//usr/lib/jvm/jdk1.6.0_35/bin/
export JAVA_ROOT=//usr/lib/jvm/jdk1.6.0_35/
export JDK_HOME=//usr/lib/jvm/jdk1.6.0_35/
export JRE_HOME=//usr/lib/jvm/jdk1.6.0_35/
Some software like jEdit use these variables to detect Java.
Though these instructions are for Ubuntu and openSuse, they might work for other distros.
Hope this helps as I got from other sources.
Thanks for reading.
NICE BLOG!!! Thanks for your valuable information, It would be really helpful for us, and I was looking for this. Thanks and keep sharing..
ReplyDeletemobile app development
Thanks for sharing this informative blog..
ReplyDeleteAndroid Training in Chennai
excellent...!!!
ReplyDeleteSelenium training in chennai
Industrial visit in chennai
Internship
Internships in bangalore for cse students 2019
Free internship in chennai for cse students
Network security projects for cse
Ccna course in chennai
Inplant training in chennai for cse
Inplant training for eee students
Kaashiv infotech chennai