Ubuntu will replace sunjdk with the default openjdk1. download the installation package: jdk-7-linux-i586.tar.gz2. create the installation directory: sudomkdir/usr/lib/jvm3. decompress: tarzxvf. /jdk-7-linux-i586.tar.gz-C/usr/lib/jvm4. set the environment... ubuntu replaces sun jdk with the default open jdk 1. download the installation package to the official website: jdk-7-linux-i586.tar.gz2. create the installation directory: sudo mkdir/usr/lib/jvm3. decompress: tar zxvf. /jdk-7-linux-i586.tar.gz-C/usr/lib/jvm4. set environment variable: vim ~ /. Bashrc export JAVA_HOME =/usr/lib/jvm/jdk-7 export CLASSPATH =.: $ {JAVA_HOME}/lib :$ {JRE_HOME}/lib export PATH =$ {JAVA_HOME}/bin: $ PATH to close the terminal, reopen sudo update-alternatives -- install/usr/bin/java/usr/lib/jvm/jdk-7/bin/java 300 sudo update-alternatives -- install/usr/bin/javac javac/usr/lib/jvm/jdk-7/bin/javac 300 sudo update-alternatives -- config java display: select path priority status ready * 0/usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 automatic mode 1/usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode 2/usr/lib/jvm/java-6-sun/jre/bin/java 63 enter the selected number in manual mode: 2 Press Enter 4. verify that the java-version has been changed to sun's jre
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.