Configure JDK under ubuntu

1. The essence of configuring JDK on ubuntu is the same as that on win. First, go to the official website to download the jdk suitable for your computer: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads -1880260.html

2. Copy jdk to usr/lib/jvm (jvm is a new folder)

//It should be noted here that when creating new folders and copying files in lib, you must go to the terminal to enter commands.

3. Then configure the JDK environment:

First enter the command in the terminal:

sudo gedit /etc/profile//this is the profile in your computer

 Add at the end of the profile:

#set jdk environment  
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_79 //Here is the version of JDK, according to your own changes
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$CLASSPATH  
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH

Here, if you want to update the latest version of jdk, just follow the above steps to change the version number when configuring the environment. 

Then save and exit.

Then enter the command in the terminal:

source /etc/profile

This command will make the configuration take effect.

Then enter the command:

java -version

Check if your JDK has been configured successfully.

If successful, the following information is displayed:

java version "1.7.0_79"  
Java(TM) SE Runtime Environment (build 1.7.0_79-b11)  
Java HotSpot(TM) Server VM (build 23.21-b01, mixed mode)  

 

or:

WebStorm is based on Java, we need to install Oracle JDK support, use the following command to install:

sudo add-apt-repository ppa:webupd8team/java

sudo apt-get update

sudo apt-get install oracle-java7-installer

sudo apt-get install oracle-java7-set-default

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326527443&siteId=291194637