Skip to main content

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.

Comments

Popular posts from this blog

Set the time zone on an Amazon EC2 instance

We can set the timezone on an Amazon EC2 instance to CST by using following steps: Login to your EC2 instance. Execute the command: “sudo su” to become a root user. Execute the command: “timedatectl” to know the current timezone details. Execute the command: “rm /etc/localtime” ( Press Enter). For confirmation type “Y” and Press Enter. Execute the command: “cd /usr/share/zoneinfo” (Press Enter). Execute the command: “ln -s /usr/share/zoneinfo/Asia/Kolkata /etc/localtime” (Press Enter). Now check the timezone by using “timedatectl” command. That’s it. Timezone changed to CST successfully.(No need to reboot) Reference: https://www.quora.com/How-do-I-set-the-time-zone-on-an-Amazon-EC2-instance-to-CST https://stackoverflow.com/questions/11931566/how-to-set-the-time-zone-in-amazon-ec2

Kubernetes cluster installation using kubeadm

  On Both Master and Slave Nodes Install docker following  Official Docker Installation Guide Switch to root user sudo su - Change docker cgroup driver cat > /etc/docker/daemon.json <<EOF { "exec-opts": ["native.cgroupdriver=systemd"], "log-driver": "json-file", "log-opts": { "max-size": "100m" }, "storage-driver": "overlay2" } EOF systemctl daemon-reload systemctl restart docker Update the  apt  package index and install packages needed to use the Kubernetes  apt  repository: sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl Download the Google Cloud public signing key: sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg Add the Kubernetes  apt  repository: echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernete