Java development environment built on top of Ubuntu

The command line

Install the JRE on Ubuntu and Linux Mint

Open a terminal, using the following command to install JRE:

  1. sudo apt-get install default-jre

OpenJDK installed on Ubuntu and Linux Mint

In the end, use the following command to install OpenJDK Java Development Kit:

  1. sudo apt-get install default-jdk

Special, if you want to install Java 7 Java 6 or so on, you can use openjdk-7-jdk / openjdk-6jdk, but keep in mind before installing openjdk-7-jre / openjdk-6-jre.

 

By installation package

1. Download jdk.

download link

2, verify java installation, use the java -version command, described below is not installed as shown:

3. Unzip the downloaded installation package

4, configure the system environment variables, edit / etc / profile file, add it at the end of the file information:

export JAVA_HOME=/usr/jdk1.8.0_101
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin

export JAVA_HOME = / usr / jdk-8 is disposed in the main directory jdk

export JRE_HOME = $ JAVA_HOME / jre jre directory configuration

export CLASSPATH =:. $ CLASSPATH: $ JAVA_HOME / lib: $ JRE_HOME / lib directory is configured CLASSPATH

export PATH = $ PATH: $ JAVA_HOME / bin: $ JRE_HOME / bin directory of the jdk executable files added to the system directory system environment

As shown below:

5, using the source / etc / profile command to make the information just is configured, as shown below:

6, again using the java -version command to verify, as shown below:

Published 47 original articles · won praise 121 · views 680 000 +

Guess you like

Origin blog.csdn.net/guoyunfei123/article/details/84944300