Install, configure, and uninstall JDK in Ubuntu

Source: Internet
Author: User
First, download JDK from the official Oracle website. Bytes. Go to the directory where the jdk-6u31-linux-i586.bin is located 1) Change file permissions sudochmodu + x

First, download JDK from the official Oracle website.

Http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u31-download-1501634.html

Here I downloaded the jdk-6u31-linux-i586.bin.

Go to the directory where the jdk-6u31-linux-i586.bin is located

1) Change File Permissions

Sudo chmod u + x jdk-6u31-linux-i586.bin

2) install JDK

Sudo-s./jdk-6u31-linux-i586.bin


Press enter and enter yes.

Configure Environment Variables

Run sudo gedit/etc/profile


Open the profile file, enter the following content at the bottom of the profile file, and save it.

# Set java environment

Export JAVA_HOME =/home/wenqisun/swq/jdk1.6.0 _ 31
Export JRE_HOME =/home/wenqisun/swq/jdk1.6.0 _ 31/jre
Export CLASSPATH = ".: $ JAVA_HOME/lib: $ JRE_HOME/lib: $ CLASSPATH"
Export PATH = "$ JAVA_HOME/bin: $ JRE_HOME/bin: $ PATH"

Restart the computer and enter java-version to view the java version information. If the following result is displayed, the configuration is successfully installed.

Www.linuxidc.com @ Ubuntu :~ $ Java-version

Java version "1.6.0 _ 31"

Java (TM) SE Runtime Environment (build 1.6.0 _ 31-b04)
Java HotSpot (TM) Client VM (build ipv6-b01, mixed mode, sharing)

Www.linuxidc.com @ ubuntu :~ $

How to uninstall JDK:

In Terminal, enter the JDK directory and run the rm command to delete the JDK.

Then, use sudo gedit/etc/profile to open the profile and modify the JDK environment variables to completely delete the JDK environment.

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

Related Article

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.