you're reading...
Java, Linux

Install Java JDK 7 and JRE manually on Linux

Install Java Development Kit

unzip the Java Development Kit

tar -xvf jdk-7u72-linux-x64.tar.gz

copy the Java Development Kit folder to /usr/lib

cp -R jdk1.7.0_72 /usr/lib/jvm

Now run

update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_72/bin/java" 1
update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0_72" 1
update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0_72/bin/javaws" 1

This will let Oracle JDK a priority of 1

change the permission of the file and the permissions of the executable:

chmod a+x /usr/bin/java
chmod a+x /usr/bin/javac
chmod a+x /usr/bin/javaws
chown -R root:root /usr/lib/jvm/jdk1.7.0_72

Java JDK has many more executables that you can similarly install as above. java, javac, javaws are probably the most frequently required.


update-alternatives --config java

You will see output as below – choose the option with JDK1.7.0_72

[root@newzonetechdb02 ~]# update-alternatives --config java

There are 3 programs which provide ‘java’.

  Selection    Command
*+ 1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   2           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
   3           /usr/lib/jvm/jdk1.7.0_72/bin/java

Enter to keep the current selection[+], or type selection number: 3

Repeat the above for:

update alternatives config javac
update alternatives config javaws

How can I install Sun/Oracle’s proprietary Java JDK 6/7/8 or JRE? askubuntu.com Retrieved on 2014-10-20


About daviewning

I am an Oracle DBA


No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: