Install JDK in Ubuntu of any version is as follow

step 1:- first of all download JDK from Oracle tar.gz file of jdk .

step 2 :- Open the terminal Ctrl+Alt+T.

step 3:- go to path of where you have download jdk.

By terminal basically if is saved in Download folder by default.

For that you have to type this command in terminal

$cd Download

step 4 :- By $ls command  you can see your files in that jdk is there is not that you have not download or you can save in another directory.

Now you have to extract file for that type the command

$ tar -xvf  jdk<file name>

like i have  jdk-8u31-linux-x64.tar.gz

$ tar -xvf jdk-8u31-linux-x64.tar.gz

step 5 :- Than it will create the folder of your jdk version in that directory

now you have to move that folde in root directory.for that you have to create the folder in the root directory

type the following command

$ sudo mkdir -p  /usr/ibjvm/dk<your version of java>

step 6:- folder will create in following path.now you have to move your jdkextract folder   in root directory with you create in /usr/lib/jvm/jdk<version>

for that type command

$sudo mv jdk<your version>/*  /usr/lib/jvm/jdk<you version>

like :-sudo mv jdk1.8.0_31/* /usr/lib/jvm/jdk1.8.31/

step 7:- it will move your all data and file in extract folder in that directory folder. now you have to SET environment

step 8:- $gedit /ect/environment it will open the window. at the end in the qouts(“”)you have to write semicolon (:)path of you jdk version of bin folder :/usr/lib/jvm/jdk1.8.0_31/bin”

step 9 : now restart your pc than open terminal and type command for check version of java have install properly or not $java -version than its display your version of java

Screenshot from 2015-06-21 12:11:17Screenshot from 2015-06-21 11:51:57

 

———————————————————-Thank you————————————————–

Advertisements