Install and configure the JDK1.6.30 service in Ubuntu11.10
Source: Internet
Author: User
Installation environment: Ubuntu11.1032 bit, jdk-6u30-linux-i586.bin. 1. download JDK. Official http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u30-download-1377139.html , Select the jdk installation environment under LinuxX86: Ubuntu 11.10 32-bit, jdk-6u30-linux-i586.bin. 1. download JDK. Official http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u30-download-1377139.html Select the jdk-6u30-linux-i586.bin under Linux X86, so that the direct use of Thunder download, fast, put on the local machine. 2. open the terminal of Ubuntu 11.10. Run the following command: Java code sudo cp jdk-6u30-linux-i586.bin/usr/lib/jvm cd/usr/lib/jvm sudo. /jdk-6u30-linux-i586.bin sudo mv jdk1.6.0 _ 30/java-1.6.0_30-sun/sudo ln-s java-1.6.0_30-sun java-6-sun sudo rm jdk-6u30-linux-i586.bin note: If there is no other version of JDK installed in the system, the JVM directory does not exist, you need to create it first. Java code sudo mkdir/usr/lib/jvm 3. set environment variables, including PATH, CLASSPATH, and JAVA_HOME, note the Java code sudo vi/etc/environment PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin: /usr/bin:/sbin:/bin:/usr/games: /usr/lib/jvm/java-6-sun/bin "CLASSPATH ="/usr/lib/jvm/java-6-sun/lib "JAVA_HOME ="/usr/lib /jvm/java-6-sun "4. tell the system, we use sun's JDK instead of OpenJDK's Java code sudo update-alternatives -- install/usr/bin/java/usr /Lib/jvm/java-6-sun/bin/java 300 sudo update-alternatives -- install/usr/bin/javac/usr/lib/jvm/java-6-sun /bin/javac 300 sudo update-alternatives -- config java 5. select the path priority state Java code 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/bin/java 300 manual mode input value: 2. press enter 6. Finally, let's verify the Java code zhunian @ Ubuntu :~ $ Java-version java version "1.6.0 _ 30" Java (TM) SE Runtime Environment (build 1.6.0 _ 30-b12) Java HotSpot (TM) Server VM (build between 5-b03, mixed mode) zhunian @ Ubuntu :~ $ Javac-version javac 1.6.0 _ 30 author znhyz1
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