Configure Java environment variables in ubuntu10.04

Source: Internet
Author: User

After more than five hours, I finally upgraded ubuntu9.10 to ubuntu10.04. The new version's close button is moved to the upper left corner. Like a Mac, I am not used to it, but it seems to be displayed.
The driver is much better than before, and the interface is much clearer than before. You Need To Know That Ati's driver will always make the user vomit blood ~~

Incoming positive
Question !!! Ubuntu10.04 openjdk is installed by default, but it is better to develop based on Sun JDK.
Install apt-get first
Run the sudo apt-Get install sun-java6-jdk,
Unexpected! Note:

Reading the package list... complete

Analyzing the dependency tree of the software package

Reading status information... complete

No software packages available now
Sun-java6-jdk, but it is referenced by other software packages.

Or it can only be found in other release sources






Official Origin

Only open JDK, sun
JDK is gone, and no source for Netease is available. Isn't this a counterattack from the open source community for Oracle's acquisition of sun? ^_^

I had to download it from the official website.

Http://java.sun.com/javase/downloads/widget/jdk6.jsp
,
The downloaded file is a jdk-6u20-linux-i586.bin, the file is downloaded to/usr/lib/JVM/sun_java

First enter the Directory

Code:

CD/usr/lib/JVM/sun_java

Add Permissions


Code:

Sudo chmod U + x jdk-6u20-linux-i586.bin

Run binary files


Code:

Sudo./jdk-6u20-linux-i586.bin
Then, follow the on-screen prompts and install the jdk1.6.0 _ 20 directory.



2. Configure Environment Variables

Code:Sudo gedit/etc/profile

Add:



Export java_home =/usr/Java/jdk1.5.0 _ 12
Export Path = $ java_home/bin: $ java_home/JRE/bin: $ path


Export
Classpath = $ classpath:.: $ java_home/lib: $ java_home/JRE/lib













If you install JDK
If the directory is different from mine, you just need to change the path after "=" in the first line to your installation directory path, and do not need to modify the second and third lines!




Then configure
Effect: Execute

Code:Source
/Etc/profile

You can run the following command to check whether the operation is successful.

Code:Java-version




If:


Java
Version "1.6.0 _ 20"
Java (TM) se
Runtime Environment (build 1.6.0 _ 20-b02)

Java hotspot (TM) server VM (build 16.3-b01,
Mixed Mode)






This
Environment variables are set successfully!



From: http://kongruxi.blog.163.com/blog/static/4325639520104111654510/

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.