Responsive Ads Here

Sunday, 26 August 2018

installing oracle jdk on linux



1. sudo apt-get purge openjdk-\*

2. sudo mkdir -p /usr/local/java

3. sudo cp -r jdk-7u45-linux-x64.tar.gz /usr/local/java

4. cd /usr/local/java

5. sudo tar xvzf jdk-7u45-linux-x64.tar.gz

6. sudo gedit /etc/profile OR sudo nano /etc/profile

7. In the /etc/profile Type/Copy/Paste:
 JAVA_HOME=/usr/local/java/jdk1.8.0_152
 JRE_HOME=$JAVA_HOME/jre
 PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
 export JAVA_HOME
 export JRE_HOME
 export PATH

8. sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.8.0_152/jre/bin/java" 1

9. sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.8.0_152/bin/java" 1

10. sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk1.8.0_152/jre/bin/javaws" 1

11. sudo update-alternatives --set java /usr/local/java/jdk1.8.0_152/jre/bin/java

12. sudo update-alternatives --set java /usr/local/java/jdk1.8.0_152/bin/java

13. sudo update-alternatives --set javaws /usr/local/java/jdk1.8.0_152/bin/javaws

14. (OPTIONAL) Type/Copy/Paste:    . /etc/profile
To Reload your system wide PATH /etc/profile

15. java -version

16. javac -version

17. Reboot









To enable your Java plug-in in your web browsers you must make a symbolic link from the web browsers plug-in directory to the location of the Java plug-in included in your distribution of Oracle Java.
Important Note: I would urge caution when enabling Oracle Java 7 in your web browsers, due to the fact there have been many numerous security flaws and exploits. Essentially, by enabling Oracle Java 7 in your web browsers if a security flaw or exploit is discovered this is how the bad guys break in and compromise your system. For more information on security flaws and exploits in Java see the following website: Java Tester
Chrome:

1. Issue the following commands.
Type/Copy/Paste: sudo mkdir -p /opt/google/chrome/plugins
this will create a directory called /opt/google/chrome/plugins
Type/Paste/Copy: cd /opt/google/chrome/plugins
this will change you into the google chrome plugins directory,make sure you are in this directory before you make the symbolic link
Type/Paste/Copy: sudo ln -s /usr/local/java/jre1.7.0_45/lib/amd64/libnpjp2.so
this will create a symbolic link from the Java JRE( Java Runtime Environment ) plugin libnpjp2.so to your Google Chrome web browser

Note: Sometimes when you issue the above command you may receive a message which states:
ln: creating symbolic link `./libnpjp2.so': File exists
To correct this issue simply remove the previous symbolic link using the following command:
Type/Copy/Paste: cd /opt/google/chrome/plugins
Type/Copy/Paste: sudo rm -rf libnpjp2.so
Make sure you are in the /opt/google/chrome/plugins directory before you issue the command
2. Restart your web browser and go to Java Tester to test if Java is functioning in your web browser.





Mozilla Firefox

1. Issue the following commands.
Type/Paste/Copy: cd /usr/lib/mozilla/plugins
this will change you into the directory /usr/lib/mozilla/plugins, create this directory if you do not have it
Type/Paste/Copy: sudo mkdir -p /usr/lib/mozilla/plugins
this will create the directory /usr/lib/mozilla/plugins, make sure you are in this directory before you make the symbolic link
Type/Paste/Copy: sudo ln -s /usr/local/java/jre1.7.0_45/lib/amd64/libnpjp2.so
this will create a symbolic link from the Java JRE( Java Runtime Environment ) plugin libnpjp2.so to your Mozilla Firefox web browser
Note: Sometimes when you issue the above command you may receive a message which states:
ln: creating symbolic link `./libnpjp2.so': File exists
To correct this issue simply remove the previous symbolic link using the following command:
Type/Copy/Paste: cd /usr/lib/mozilla/plugins
Type/Copy/Paste: sudo rm -rf libnpjp2.so
Make sure you are in the /usr/lib/mozilla/plugins directory before you issue the command
2. Restart your web browser and go to Java Tester to test if Java is functioning in your web browser.

No comments:

Post a comment