Install JDK and configure environment variables in Ubuntu9.04

Source: Internet
Author: User
I here to Ubuntu9.04 as an example (a) first download JDK, here is (jdk-6u14-linux-i586.bin) is not recommended to use. RPM can be used only when rpm is converted to deb in Ubuntu, but many more steps are involved. (2) Start the Ubuntu terminal and switch to the root account to log on: sudosu switches to the root permission sudopasswdroot. Here we set a password for the root account.

Take Ubuntu9.04 as an example.

(A) First download JDK, here is (jdk-6u14-linux-i586.bin) is not recommended to use. RPM because in Ubuntu rpm also need to be converted to deb to use, but a lot more steps.

(2) Start Ubuntu to open the terminal and switch to the root account to log on:

Sudo su

Switch to root permission

Sudo passwd root

Set a password for the root account. The root account is enabled.

Next, log out and log on to Ubuntu as the root user.

(3) After logging on as root, create a folder under/usr/lib and name it jvm.

You can also use the graphical interface. The terminal is mkdir jvm (note: the terminal is located under/usr/lib)

Go back to the jdk-6u14-linux-i586.bin directory and move the jdk-6u14-linux-i586.bin to the jvm file:

Music jdk-6u14-linux-i586.bin/usr/lib/jvm

(4) install JDK

Make sure that the terminal is in/usr/lib/jvm and then run

Sudo./jdk-6u14-linux-i586.bin

If More appears at this time, press enter until you are prompted to enter yes or no, and enter y

Wait until "... Done! "Or something, just install it.

At this time/usr/lib/jvm will have a jdk-6u14-linux-i586 folder with everything in it

(5) environment variable configuration

The Configuration value of environment variables in linux is mainly about modifying/etc/enviroment.

Modify the enviroment File

Sudo gedit/etc/enviroment

Then edit enviroment:

PATH = ". :/usr/lib/jvm/jdk1.6.0 _ 14/bin:/usr/lib/jvm/jdk1.6.0 _ 14/lib: /usr/lib/jvm/jdk1.6.0 _ 14/jre/bin:/usr/lib/jvm/jdk1.6.0 _ 14/jre/lib:/usr/local/sbin: /usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

CLASSPATH = ".:/usr/lib/jvm/jdk1.6.0 _ 14/lib"

JAVA_HOME = "/usr/lib/jvm/jdk1.6.0 _ 14"

Save files

Log out and log on again.

(6) test

Open terminal Input

Java

Javac

The Correct prompt is displayed, indicating that the installation is successful!

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.