Install and configure JDK7 in Ubuntu10.10 Step 1: Download jdk-7-linux-i586.tar.gz wget-chttp: // rewrite (note: If the download fails, we recommend that you use thunder to download it and copy it to Linu... install and configure JDK 7 in Ubuntu 10.10. Step 1: Download jdk-7-linux-i586.tar.gz
Http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-i586.tar.gz wget-c
(Note: If the download fails, we recommend that you use thunder to download it and copy it to the Linux system .) Step 2: unzip and install sudo tar zxvf./jdk-7-linux-i586.tar.gz-C/usr/lib/jvm cd/usr/lib/jvm Step 3: modify the environment variable vim ~ /. Bashrc Add: export JAVA_HOME =/usr/lib/jvm/jdk1.7.0 _ 03 export JRE_HOME =$ {JAVA_HOME}/jre export CLASSPATH =.: $ {JAVA_HOME}/lib :$ {JRE_HOME}/lib export PATH =$ {JAVA_HOME}/bin: $ PATH
Save and exit. enter the following command to make it take effect immediately. Source ~ /. Bashrc Step 4: configure the default JDK Version
Ubuntu may have a default JDK, such as openjdk. to set the JDK we installed as the default JDK Version, perform the following work. Run the code: sudo update-alternatives -- install/usr/bin/java/usr/lib/jvm/jdk1.7.0 _ 03/bin/java 300 sudo update-alternatives -- install/usr/bin/javac javac/usr/lib/jvm/jdk1.7.0 _ 03/bin/javac 300 sudo update-alternatives -- install/usr/bin/jar/usr/lib/jvm/jdk1.7.0 _ 03/ bin/jar 300 www.2cto.com: the sudo update-alternatives -- config java system lists various JDK versions, as shown below:
Snowdream @ snowdream :~ $ Sudo update-alternatives -- config java
Three candidate items can be used to replace java (/usr/bin/java ). 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 Manual Mode 3/usr/lib/jvm/jdk1.7.0 _ 03/bin/java 300 to maintain the current value in manual mode [*], press enter, alternatively, enter the selected number: 3 update-alternatives:/usr/lib/jvm/java-7-sun/bin/java to provide/usr/bin/java (java ), in manual mode. Step 5: test snowdream @ snowdream :~ $ Java-version java version "1.7.0 _ 03" Java (TM) SE Runtime Environment (build 1.7.0 _ 03-b04) Java HotSpot (TM) Server VM (build 22.1-b02, mixed mode) remarks: many jdks' libraries installed on the network are binary files based on jdk6, and now all files are tar.gz compressed files on the official network. Therefore, these methods are of little reference.
Author 2B pseudo-code Nong
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service