Install JDK 6 + Tomcat 7 in Ubuntu11.04

Source: Internet
Author: User
Install JDK first, because sun's jdk has been canceled from the official source since Ubuntu10.04, so you need to download the binfile from sun. I use a 64-bit system, so I need to download a binfile named "Linuxx86_64. Sun provides the following installation instructions: 1. download an object. 2. create the/usr/lib/jvm/java directory and copy the downloaded file to the directory. and enter the/usr/lib/jvm/java directory.

Install JDK first, because sun's jdk has been removed from the official source since Ubuntu 10.04, so you need to download the binfile from sun. I use a 64-bit system, so I need to download the binfile named "Linux x86_64.

Sun provides the following installation instructions:

1. download the file.

2. Create the/usr/lib/jvm/java directory, copy the downloaded file to this directory, and enter the/usr/lib/jvm/java directory.

3. Set the running permission

Run the following command:

% Chmod + x 6u Linux-x64.bin

4. decompress the file.

Run the command: %./jdk-6u Linux-x64.bin

The JDK file will be decompressed in the current path named jdk.6.0 _ Directory.

5. Run sudo gedit/etc/environment to add the configuration.

PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games: /usr/lib/jvm/java/jdk.6.0 _ /Bin"
CLASSPATH = ".:/usr/lib/jvm/java/jdk1.6.0 _ 25/bin/lib"
JAVA_HOME = "/usr/lib/jvm/java/jdk1.6.0 _ 25"

Run

./Etc/environment

Then input the following in the command line:

Java-version

Java version "1.6.0 _ 25"
Java (TM) SE Runtime Environment (build 1.6.0 _ 25-b06)
Java HotSpot (TM) 64-Bit Server VM (build phases 0-b11, mixed mode)

OK. JDK has been installed.

---------------- Split line -------------- another article ----------------

There are two types of Java, one of which is the Ubuntu source with open-java (icedtea). OpenJDK is a group established by Sun to develop the Java SE open Source implementation. One is an Oracle sun-java6. The former is Ubuntu's default Java, where sun-java6 is used.

Currently, the JAVA source of Ubuntu 11.04 has not been updated and cannot be installed officially. There are two solutions:

A. install Java (JRE/JDK and Java INS) in Ubuntu11.04 using the software libraries related to Ubuntu 10.10)

Add Source

add-apt-repository "deb http://archive.canonical.com/ lucid partner"

Note: If the system prompts no add-apt-repository command, install python-software-properties and run sudo apt-get install python-software-properties first. In addition, some ubuntu versions of www.linuxidc.com do not have the add-apt-repository command even if python-software-properties is installed, at this point you need to manually add this line "deb http://archive.canonical.com/ubuntu maverick partner" to/etc/apt/sources. list file .)

Manually add source method

vi /etc/apt/source.list deb http://archive.canonical.com/ubuntu maverick partner"

Install Java JDK

apt-get updateapt-get install sun-java6-jdk

Note: during the installation process, you need to answer whether you agree to use the Protocol (the red-blue prompt page in the terminal). Press the tab key to OK, and press enter to install it normally.

If you want to install Java JRE and Java plugin, run the following command:

apt-get install sun-java6-jre sun-java6-plugin

B. install java in Ubuntu11.04 using PPA

Use the Ubuntu PPA Method for installation. First add the source:

add-apt-repository ppa:ferramroberto/java

Install Java JDK

apt-get updateapt-get install sun-java6-jdk

To install Java JRE and Java plugin, run the following command:

apt-get install sun-java6-jre sun-java6-plugin

Note: PPA is short for Personal Package Archive. It is a source service provided by the Ubuntu Launchpad website that allows individual users to upload software source code, compile through Launchpad and release it as a binary software package, which serves as an apt/new source for other users to download and update. PPA is a collection of software not included in Ubuntu by default. Www.linuxidc.com usually focuses on a single program, but they can also contain more content, depending on the maintainer of these repositories. A ppa may be concerned with an unpublished software. PPA provides updates to your favorite software at a much faster speed than Ubuntu itself.

Set the current default java interpreter and compiler (skip this step if multiple java virtual machines are not installed)

update-java-alternatives -s java-6-sun

C. Configure JAVA environment variables

vi /etc/environment JAVA_HOME=/usr/lib/jvm/java-6-sunCLASSPATH=.:/usr/lib/jvm/java-6-sun/lib

Run the following command to make the configuration take effect:

. /etc/environment

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.