Ubuntu14.04 install and configure jdk7

Source: Internet
Author: User

Ubuntu14.04 install and configure jdk7

1. Download:

Go to http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html to download the JDK. I am going to dk-7u55-linux-x64.tar.gz.

Default placed in/home/licheng/xiazai/jdk-7u55-linux-x64.tar.gz. Install non-system software in the/opt directory. [You can select the Directory and create the directory on your own. This is a path problem.] [use fty or SSH to upload the directory to the server]

2) decompress the file:Press Ctrl + Alt + T to open the terminal,Run

Sudo cp/home/licheng/xiazai/jdk-7u55-linux-x64.tar.gz/opt (copy the file to the opt folder)
Cd/opt (switch to opt)
Sudo tar-zxvf jdk-7u55-linux-x64.tar.gz (archive extracted files)

Run the ls command and you will see the jdk1.7.0 _ 55 folder under opt.

3) configure the java environment.Run
Sudo gedit/etc/profile (modify environment variables)
Add configuration at the end of the file, save and exit
# Set jdk environment
Export JAVA_HOME =/opt/jdk1.7.0 _ 55
Export CLASSPATH =.: $ JAVA_HOME/lib: $ JAVA_HOME/jre/lib: $ CLASSPATH
Export PATH = $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin: $ PATH

4) check whether the configuration is successful.Open the terminal and enter

Source/etc/profile
Java-version

As shown below, the configuration is successful
Java version "1.7.0 _ 55"
Java (TM) SE Runtime Environment (build 1.7.0 _ 55-b13)
Java HotSpot (TM) 64-Bit Server VM (build 24.55-b03, mixed mode)

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.