RHMSCN
Friday, March 4, 2016
Install Java 1.7 in Ubuntu 13.10
Install
Java 1.7 in Ubuntu 13.10
1.
Login as a User which has administrator rights
2.
Open Terminal (Ctrl + Alt + T).
3.
Type sudo su root
4.
Give the password of the user which you have logged in.
5.
Create the installation folder.
The
/usr/lib/jvm is the default installation location of the Java JDK.
Enter the following command in your Terminal to create this folder,
if it does not already exist:
sudo
mkdir -p /usr/lib/jvm
The
–p option ensures that all folders in the mkdir path are created.
6. Change the rights
for the folder.
chmod -R 777
/usr/lib/jvm
7. Now copy your JDK
folder in /usr/lib/jvm directory
8. Again change the
right of the windows folder.
Chmod -R 777
/usr/lib/jvm
9.
Navigate to the “installation folder”.
cd
/usr/lib/jvm
10
. Display the contents of the installation folder.
ls
–l
Response:
jdk1.7.0_45
Make
a note of the newly created folder names.
11.
Inform Ubuntu where your Java installation is located.
sudo
update-alternatives --install "/usr/bin/javac" "javac"
"/usr/lib/jvm/jdk1.7.0_45/bin/javac" 1
sudo
update-alternatives --install "/usr/bin/java" "java"
"/usr/lib/jvm/jdk1.7.0_45/bin/java" 1
12.
Inform Ubuntu that this is your default Java installation.
sudo
update-alternatives --set "javac"
"/usr/lib/jvm/jdk1.7.0_45/bin/javac"
sudo
update-alternatives --set "java"
"/usr/lib/jvm/jdk1.7.0_45/bin/java"
13.
Update your system-wide PATH.
Edit
your /etc/profile file using:
sudo
nano /etc/profile
Add
the following entries to the bottom of your /etc/profile file:
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_45
PATH=$PATH:$JAVA_HOME/bin
export
JAVA_HOME
export
PATH
Save
your /etc/profile file using CTRL + X.
14.
Reload your system-wide PATH.
.
/etc/profile
15.
Step 13: Test your new installation.
16.
java –version
Note
there is only a single dash before version.
Response:
Response:
java
version 1.7.0_45
Java(TM)
SE Runtime Environment (build 1.7.0_45-b18)
Java
HotSpot(TM) Client VM (build 24.45-b08, mixed mode)
17.
javac –version
Note
there is only a single dash before version.
Response:
Response:
javac
1.7.0_45
Subscribe to:
Posts (Atom)