Install and configure the Java environment in Ubuntu16.04LTS

Source: Internet
Author: User
We know that openjdk may be installed in Ubuntu in advance. However, I am used to Oraclejdk. ##& Lt; uninstall openjdk & gt; ### Terminalcommand: sudoapt-getpurgeopenjdk/openjdk *; sudoapt-getclean/autoclean; we should delete openjdk from the system. # & Lt; download and install O

We know that openjdk may be installed in Ubuntu in advance. But I am used to Oracle jdk.

##< Uninstall openjdk>

### Terminal command: sudo apt-get purge openjdk/openjdk *; sudo apt-get clean/autoclean;

We should delete openjdk from the system.

# <Download and install Oracle jdk>

### Terminal command: tar-zxvf jdk-8u77-linux-x64.tar.gz;
Sudo mv./jdk-8u77-linux-x64/opt/Java

Download Oracle jdk needs to Oracle (http://www.oracle.com/) Oracle jdk official website (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html), according to different operating systems provide different installation packages, download the corresponding software packages.

Decompress the package on the Ubuntu Desktop and move it to/opt/Java. In this way, a separate folder is provided for you to manage and set environment variables. So far, if everything is correct, then let'sSet Environment Variables.

# <Jdk environment variable Settings>

### Terminal command: sudo gedit/etc/profile; source/etc/profile

'''

Export JAVA_HOME =/opt/Java/java version

Export JRE_HOME =$ {JAVA_HOME}/jre

Export CLASSPATH =.: java h ome/lib: JAVAHOME/lib: {JRE_HOME}/lib

Export PATH = java h ome/bin: JAVAHOME/bin: PATH

'''

Test whether the environment variables are correctly set

'''

$ Java-version

$ Javac

'''

##< Install eclipse>

### Terminal command:
Sudo tar-zxvf eclipse=java%mars%2%linux%gtk%x86_64.tar.gz;
Mv./eclipse-java-mars-2-linux-gtk-x86_64

Eclipse, as an open-source software, is suitable for java development. Eclipse (http://www.eclipse.org/) Linux X64 version (http://mirrors.ustc.edu.cn/eclipse/technology/epp/downloads/release/mars/2/eclipse-java-mars-2-linux-gtk-x86_64.tar.gz). Unzip it and put it in the folder you feel suitable.

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

This article permanently updates link: http://www.linuxidc.com/Linux/2016-04/129731.htm

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.