Tuesday, May 5, 2015

How to Install Oracle Java to Linux

Download java package from oracle and install it.

(See: How to download JDK directly from Oracle from command line)


for RedHat/CentOS/Fedora, the location of the installation is /usr/java/latest
$ sudo -i alternatives --install /usr/bin/java java /usr/java/latest/bin/java 1
1 is for the priority.

for Ubuntu:
$ sudo -i update-alternatives --install /usr/bin/java java /home/i88ca/Downloads/jdk1.8.0_05/bin/java 1
You can put "" if you have special character, such as:
$ sudo -i update-alternatives --install /usr/bin/java java "/home/i88ca/Downloads/jdk1.8.0_05/bin/java" 1
Run the alternatives program again, to chose the new installation
for RedHat:
$ sudo -i alternatives --config java
for Ubuntu:
$ sudo update-alternatives --config java
Verify that you are getting the right version of Java
$ java -version
You may want to configure javac too, just do similar as above, change java to corresponding javac of course.





Popular Posts

Labels

ad ( 5 ) Amazon ( 42 ) Answer ( 1 ) API ( 23 ) automation ( 1 ) blog ( 22 ) book ( 2 ) business ( 1 ) career ( 12 ) cdn ( 3 ) centos ( 1 ) cloud ( 135 ) CRM ( 24 ) current ( 15 ) data ( 17 ) database ( 66 ) design patterns ( 17 ) development ( 3 ) document ( 1 ) eCommerce ( 26 ) email ( 94 ) ETL ( 2 ) file ( 1 ) framework ( 3 ) git ( 11 ) google ( 190 ) IDE ( 20 ) Integration ( 1 ) interview ( 16 ) Java ( 414 ) Java EE ( 112 ) javascript ( 42 ) Jboss ( 4 ) JPA ( 51 ) JSF ( 44 ) linux ( 337 ) Marketing ( 21 ) mobile ( 45 ) model ( 1 ) MySQL ( 199 ) online money ( 16 ) OOP ( 7 ) open source ( 26 ) performance ( 73 ) php ( 51 ) python ( 46 ) quality ( 6 ) referral ( 3 ) restful ( 23 ) security ( 139 ) SEO ( 19 ) social ( 27 ) software ( 76 ) spam ( 4 ) Spring ( 1 ) SQL ( 22 ) system ( 34 ) testing ( 17 ) tool ( 96 ) UML ( 8 ) virtual ( 10 ) web ( 235 ) web services ( 14 ) WildFly ( 7 ) wordpress ( 12 )