• About
  • Contact
  • Cookie
  • Disclaimer
  • Privacy Policy
  • Change the purpose of use

Tnhelearning.edu.vn - Various useful general information portal

  • Photo
  • Bio
  • How To
  • Tech

How to Install Oracle Java on Ubuntu Linux

February 18, 2024 by admin Category: How To

You are viewing the article How to Install Oracle Java on Ubuntu Linux  at Tnhelearning.edu.vn you can quickly access the necessary information in the table of contents of the article below.

X

wikiHow is a “wiki” site, which means that many of the articles here are written by multiple authors. To create this article, 35 people, some of whom are anonymous, have edited and improved the article over time.

This article has been viewed 10,730 times.

This article will guide to install Oracle Java 7 32-bit and 64-bit (current version is 1.7.0_45 ) JDK/JRE on 32-bit and 64-bit Ubuntu operating systems. You can apply this guide to Debian and Linux Mint.

If you have installed Oracle Java 7 on the operating system but want to upgrade, please refer to the tutorial to upgrade Oracle Java on Ubuntu Linux.

For those who just want to install Oracle Java JRE to run Java applications and not develop Java programs, please refer to the tutorial on installing Oracle Java JRE on Ubuntu Linux.

For those who want to install Oracle Java JDK to develop Java programs and applications (Oracle Java JRE includes Oracle JDK), use the following method:

  • How to Install Oracle Java JDK on Ubuntu Linux

To activate/upgrade Oracle Java on a web browser, refer to the tutorial on activating Oracle Java on a web browser.

Table of Contents

  • Steps
    • Optional: How to Enable Oracle Java on Web Browser
    • Google Chrome
    • Mozilla Firefox
  • Advice

Steps

Image titled Install Oracle Java on Ubuntu Linux Step 1

Image titled Install Oracle Java on Ubuntu Linux Step 1

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/8/85/Install-Oracle-Java-on-Ubuntu-Linux-Step-1-Version-2.jpg/v4-728px- Install-Oracle-Java-on-Ubuntu-Linux-Step-1-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/8/85/Install-Oracle- Java-on-Ubuntu-Linux-Step-1-Version-2.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-1-Version-2.jpg”,”smallWidth”:460 ,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Check the Ubuntu Linux operating system you are using whether it is 32-bit or 64-bit, open a terminal and run the following command.

  • Type/Copy/Paste: file /sbin/init
    • Remember whether the version of the Ubuntu Linux operating system is 32-bit or 64-bit.
Image titled Install Oracle Java on Ubuntu Linux Step 2

Image titled Install Oracle Java on Ubuntu Linux Step 2

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/3/33/Install-Oracle-Java-on-Ubuntu-Linux-Step-2-Version-2.jpg/v4-728px- Install-Oracle-Java-on-Ubuntu-Linux-Step-2-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/3/33/Install-Oracle- Java-on-Ubuntu-Linux-Step-2-Version-2.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-2-Version-2.jpg”,”smallWidth”:460 ,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Check if Java is installed on the system. To check, run the Java version command in the terminal.

  • Open terminal and enter the following command:
    • Type/Copy/Paste: java -version
  • If you have OpenJDK installed on your system, you will see the message:
    • java version “1.7.0_15”
      OpenJDK Runtime Environment (IcedTea6 1.10pre) (7b15~pre1-0lucid1)
      OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)
  • If you have OpenJDK installed on your system then this is not the vendor version mentioned in this article.
Image titled Install Oracle Java on Ubuntu Linux Step 3

Image titled Install Oracle Java on Ubuntu Linux Step 3

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/3/3d/Install-Oracle-Java-on-Ubuntu-Linux-Step-3-Version-2.jpg/v4-728px- Install-Oracle-Java-on-Ubuntu-Linux-Step-3-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/3/3d/Install-Oracle- Java-on-Ubuntu-Linux-Step-3-Version-2.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-3-Version-2.jpg”,”smallWidth”:460 ,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Completely remove OpenJDK/JRE from the system and create a directory to store the Oracle Java JDK/JRE binaries. This is a way to avoid system conflicts and confusion between 2 different vendors’ Java versions. For example, if you have OpenJDK/JRE installed on your system, you can remove it with the following command:

  • Type/Copy/Paste: sudo apt-get purge openjdk-*
    • This is the command to completely remove OpenJDK/JRE from the system.
  • Type/Copy/Paste: sudo mkdir -p /usr/local/java
    • This is the command to create a new directory to store the Oracle Java JDK and JRE binaries.
Image titled Install Oracle Java on Ubuntu Linux Step 4

Image titled Install Oracle Java on Ubuntu Linux Step 4

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/6/67/Install-Oracle-Java-on-Ubuntu-Linux-Step-4-Version-2.jpg/v4-728px- Install-Oracle-Java-on-Ubuntu-Linux-Step-4-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/6/67/Install-Oracle- Java-on-Ubuntu-Linux-Step-4-Version-2.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-4-Version-2.jpg”,”smallWidth”:460 ,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Download Oracle Java JDK/JRE for Linux . Make sure to select the correct compressed binary for 32-bit or 64-bit operating systems (ending with tar.gz).

  • For example, if using Ubuntu Linux 32-bit, download the 32-bit Oracle Java binary.
  • For example, if using Ubuntu Linux 64-bit, download the 64-bit Oracle Java binary.
  • Optional, Download Oracle Java JDK/JRE . Documentation
    • Select jdk-7u40-apidocs.zip
  • Important information: 64-bit Oracle Java binary does not work on 32-bit Ubuntu Linux operating system, many system error messages will appear if you intentionally install 64-bit Oracle Java on Ubuntu Linux 32- bits.
Image titled Install Oracle Java on Ubuntu Linux Step 5

Image titled Install Oracle Java on Ubuntu Linux Step 5

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/a/af/Install-Oracle-Java-on-Ubuntu-Linux-Step-5-Version-2.jpg/v4-728px- Install-Oracle-Java-on-Ubuntu-Linux-Step-5-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/a/af/Install-Oracle- Java-on-Ubuntu-Linux-Step-5-Version-2.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-5-Version-2.jpg”,”smallWidth”:460 ,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Copy the Oracle Java binary to the /usr/local/java directory. In most cases, the Oracle Java binary is downloaded: /home/ “username” /Downloads.

  • Instructions for installing 32-bit Oracle Java on 32-bit Ubuntu Linux:
    • Type/Copy/Paste: cd ~/Downloads
    • Type/Copy/Paste: sudo cp -r jdk-7u45-linux-i586.tar.gz /usr/local/java
    • Type/Copy/Paste: sudo cp -r jre-7u45-linux-i586.tar.gz /usr/local/java
    • Type/Copy/Paste: cd /usr/local/java
  • Instructions to install Oracle Java 64-bit on Ubuntu Linux 64-bit:
    • Type/Copy/Paste: cd ~/Downloads
    • If you download JDK then Type/Copy/Paste: sudo cp -r jdk-7u45-linux-x64.tar.gz /usr/local/java
    • Or if you load the JRE then Type/Copy/Paste: sudo cp -r jre-7u45-linux-x64.tar.gz /usr/local/java
    • Type/Copy/Paste: cd /usr/local/java
READ More:   Revenge on narcissistic ex: 12 ways to let them down
Image titled Install Oracle Java on Ubuntu Linux Step 6

Image titled Install Oracle Java on Ubuntu Linux Step 6

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/0/0b/Install-Oracle-Java-on-Ubuntu-Linux-Step-6-Version-2.jpg/v4-728px- Install-Oracle-Java-on-Ubuntu-Linux-Step-6-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/0/0b/Install-Oracle- Java-on-Ubuntu-Linux-Step-6-Version-2.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-6-Version-2.jpg”,”smallWidth”:460 ,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Unzip the Java binary archive in the /usr/local/java . directory

  • Instructions for installing 32-bit Oracle Java on 32-bit Ubuntu Linux:
    • Type/Copy/Paste: sudo tar xvzf jdk-7u45-linux-i586.tar.gz
    • Type/Copy/Paste: sudo tar xvzf jre-7u45-linux-i586.tar.gz
  • Instructions to install Oracle Java 64-bit on Ubuntu Linux 64-bit:
    • If you download JDK then Type/Copy/Paste: sudo tar xvzf jdk-7u45-linux-x64.tar.gz
    • If you download the JRE then Type/Copy/Paste: sudo tar xvzf jre-7u45-linux-x64.tar.gz
Image titled Install Oracle Java on Ubuntu Linux Step 7

Image titled Install Oracle Java on Ubuntu Linux Step 7

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/3/31/Install-Oracle-Java-on-Ubuntu-Linux-Step-7-Version-2.jpg/v4-728px- Install-Oracle-Java-on-Ubuntu-Linux-Step-7-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/3/31/Install-Oracle- Java-on-Ubuntu-Linux-Step-7-Version-2.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-7-Version-2.jpg”,”smallWidth”:460 ,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Check the folder again. At this step you should have an unzipped Java JDK/JRE binary directory at /usr/local/java listed as follows:

  • Type/Copy/Paste: ls -a
  • jdk1.7.0_45
  • or jre1.7.0_45
Image titled Install Oracle Java on Ubuntu Linux Step 8

Image titled Install Oracle Java on Ubuntu Linux Step 8

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/8/86/Install-Oracle-Java-on-Ubuntu-Linux-Step-8-Version-2.jpg/v4-728px- Install-Oracle-Java-on-Ubuntu-Linux-Step-8-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/8/86/Install-Oracle- Java-on-Ubuntu-Linux-Step-8-Version-2.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-8-Version-2.jpg”,”smallWidth”:460 ,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Edit the /etc/profile file system path and add the following system variable to the path. Use nano, gedit or any text editing software and open /etc/profile.

  • Type/Copy/Paste: sudo gedit /etc/profile
  • or
  • Type/Copy/Paste: sudo nano /etc/profile
Image titled Install Oracle Java on Ubuntu Linux Step 9

Image titled Install Oracle Java on Ubuntu Linux Step 9

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/4/4e/Install-Oracle-Java-on-Ubuntu-Linux-Step-9-Version-2.jpg/v4-728px- Install-Oracle-Java-on-Ubuntu-Linux-Step-9-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/4/4e/Install-Oracle- Java-on-Ubuntu-Linux-Step-9-Version-2.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-9-Version-2.jpg”,”smallWidth”:460 ,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Use the arrow keys to scroll to the bottom and add the following line to that file:

  • If you install JDK then Type/Copy/Paste:
    JAVA_HOME=/usr/local/java/ jdk1.7.0_45
    JRE_HOME=$JAVA_HOME/jre
    PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
    export JAVA_HOME
    export JRE_HOME
    export PATH
  • If you install JRE then Type/Copy/Paste:
    JRE_HOME=/usr/local/java/ jre1.7.0_45
    PATH=$PATH:$JRE_HOME/bin
    export JRE_HOME
    export PATH
  • Save the file /etc/profile and exit.
Image titled Install Oracle Java on Ubuntu Linux Step 10

Image titled Install Oracle Java on Ubuntu Linux Step 10

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/1/10/Install-Oracle-Java-on-Ubuntu-Linux-Step-10-Version-2.jpg/v4-728px- Install-Oracle-Java-on-Ubuntu-Linux-Step-10-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/1/10/Install-Oracle- Java-on-Ubuntu-Linux-Step-10-Version-2.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-10-Version-2.jpg”,”smallWidth”:460 ,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Inform the Ubuntu Linux system the location of the Oracle Java JDK/JRE. The command will notify the system that a new version of Oracle Java is ready for use.

  • If you install JDK then Type/Copy/Paste: sudo update-alternatives –install “/usr/bin/java” “java” “/usr/local/java/jdk1.7.0_45/jre/bin/java” first
  • If you install JRE then Type/Copy/Paste: sudo update-alternatives –install “/usr/bin/java” “java” “/usr/local/java/jre1.7.0_45/bin/java” 1
    • This is a command that notifies the system that the Oracle Java JRE is ready for use.
  • Only if you install JDK then Type/Copy/Paste: sudo update-alternatives –install “/usr/bin/java” “java” “/usr/local/java/jdk1.7.0_45/bin/java” 1
    • This is the command that notifies the system that the Oracle Java JDK is ready for use.
  • Type/Copy/Paste: sudo update-alternatives –install “/usr/bin/javaws” “javaws” “/usr/local/java/jre1.7.0_45/bin/javaws” 1
    • This is a command that notifies the system that Oracle Java Web is ready for use.
Image titled Install Oracle Java on Ubuntu Linux Step 11

Image titled Install Oracle Java on Ubuntu Linux Step 11

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/8/80/Install-Oracle-Java-on-Ubuntu-Linux-Step-11-Version-2.jpg/v4-728px- Install-Oracle-Java-on-Ubuntu-Linux-Step-11-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/8/80/Install-Oracle- Java-on-Ubuntu-Linux-Step-11-Version-2.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-11-Version-2.jpg”,”smallWidth”:460 ,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Notify the Ubuntu Linux system that the Oracle Java JDK/JRE is your default Java.

  • If you install JDK then Type/Copy/Paste: sudo update-alternatives –set java /usr/local/java/jdk1.7.0_45/jre/bin/java
  • If you install JRE then Type/Copy/Paste: sudo update-alternatives –set java /usr/local/java/jre1.7.0_45/bin/java
    • This is the command to set up the java runtime environment for the system.
  • Only when installing JDK then Type/Copy/Paste: sudo update-alternatives –set java /usr/local/java/jdk1.7.0_45/bin/java
    • This is the command to set up the java compiler for the system.
  • If you install JDK then Type/Copy/Paste: sudo update-alternatives –set javaws /usr/local/java/jdk1.7.0_45/bin/javaws
  • Or if you install JRE then Type/Copy/Paste: sudo update-alternatives –set javaws /usr/local/java/jre1.7.0_45/bin/javaws
    • This is the command to set up Java Web to start on the system.
Image titled Install Oracle Java on Ubuntu Linux Step 12

Image titled Install Oracle Java on Ubuntu Linux Step 12

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/2/24/Install-Oracle-Java-on-Ubuntu-Linux-Step-12-Version-2.jpg/v4-728px- Install-Oracle-Java-on-Ubuntu-Linux-Step-12-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/2/24/Install-Oracle- Java-on-Ubuntu-Linux-Step-12-Version-2.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-12-Version-2.jpg”,”smallWidth”:460 ,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Reload the /etc/profile system path by entering the following command:

  • Type/Copy/Paste: . /etc/profile
  • Note the system path /etc/profile file will reload after rebooting Ubuntu Linux system.
Image titled Install Oracle Java on Ubuntu Linux Step 13

Image titled Install Oracle Java on Ubuntu Linux Step 13

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/6/6f/Install-Oracle-Java-on-Ubuntu-Linux-Step-13-Version-2.jpg/v4-728px- Install-Oracle-Java-on-Ubuntu-Linux-Step-13-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/6/6f/Install-Oracle- Java-on-Ubuntu-Linux-Step-13-Version-2.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-13-Version-2.jpg”,”smallWidth”:460 ,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Check if Oracle Java is correctly installed on the system. Run the following command and record the Java version: If the 32-bit Oracle Java installation is successful you will see the following message:

  • Type/Copy/Paste: java -version. This is the command to display the java version on the system. You will see the message: java version “1.7.0_45”
    Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
  • Java HotSpot(TM) Server VM (build 24.45-b08, mixed mode)
  • Type/Copy/Paste: java -version. This is the command that says you can now compile Java programs from the terminal. You will get the following message: java 1.7.0_45. A successful installation of Oracle Java 64-bit will display:
  • Type/Copy/Paste: java -version. This is the command that shows the java version running on the system. You will get the following message: java version “1.7.0_45”
    Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
  • Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
  • Type/Copy/Paste: java -version. This is the command that says you can now compile Java programs from the terminal. You will get display message: java 1.7.0_45
READ More:   10 signs that you are not your lover's priority and how to handle it
Image titled Install Oracle Java on Ubuntu Linux Step 14

Image titled Install Oracle Java on Ubuntu Linux Step 14

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/a/af/Install-Oracle-Java-on-Ubuntu-Linux-Step-14-Version-2.jpg/v4-728px- Install-Oracle-Java-on-Ubuntu-Linux-Step-14-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/a/af/Install-Oracle- Java-on-Ubuntu-Linux-Step-14-Version-2.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-14-Version-2.jpg”,”smallWidth”:460 ,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Congratulations, you have successfully installed Oracle Java on your Linux system. Now just reboot the system. The system will then be fully configured to run and develop Java programs. Then you can try to compile and run your own Java program.

Optional: How to Enable Oracle Java on Web Browser

Image titled Install Oracle Java on Ubuntu Linux Step 15

Image titled Install Oracle Java on Ubuntu Linux Step 15

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/a/aa/Install-Oracle-Java-on-Ubuntu-Linux-Step-15.jpg/v4-728px-Install-Oracle- java-on-Ubuntu-Linux-Step-15.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/a/aa/Install-Oracle-Java-on-Ubuntu-Linux- Step-15.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-15.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight” :546,”licensing”:”<div class=”mw-parser-output”></div>”}
To enable the Java plug-in on a web browser, you must create a symbolic link from the browser’s plug-in directory to the location of the Java plug-in in the Oracle Java partition.

  • Important Note: You should exercise caution when activating Oracle Java 7 in your web browser due to the fact that Java has numerous security holes and exploits. More importantly, when activating Oracle Java 7 on a web browser, if there is a security hole or exploitation, this is a weak point for bad guys to infiltrate and harm your system. For more information about Java vulnerabilities and exploits, visit the website: Java Tester

Google Chrome

Oracle Java 32-bit Tutorial:

Image titled Install Oracle Java on Ubuntu Linux Step 16

Image titled Install Oracle Java on Ubuntu Linux Step 16

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/d/db/Install-Oracle-Java-on-Ubuntu-Linux-Step-16.jpg/v4-728px-Install-Oracle- Java-on-Ubuntu-Linux-Step-16.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/d/db/Install-Oracle-Java-on-Ubuntu-Linux- Step-16.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-16.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight” :546,”licensing”:”<div class=”mw-parser-output”></div>”}
Execute the following command.

  • Type/Copy/Paste: sudo mkdir -p /opt/google/chrome/plugins
    • Here is the command to create the directory /opt/google/chrome/plugins
  • Type/Copy/Paste: cd /opt/google/chrome/plugins
    • This is the command that takes you to the google chrome plugin folder, remember to go to this folder before creating the icon link
  • Type/Copy/Paste: sudo ln -s /usr/local/java/jre1.7.0_45/lib/ i386 / libnpjp2.so
    • This is the command to create a symbolic link from the Java JRE( Java Runtime Environment ) plugin libnpjp2.so to the Google Chrome browser.

Oracle Java 64-bit Tutorial:

Image titled Install Oracle Java on Ubuntu Linux Step 17

Image titled Install Oracle Java on Ubuntu Linux Step 17

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/8/87/Install-Oracle-Java-on-Ubuntu-Linux-Step-17.jpg/v4-728px-Install-Oracle- Java-on-Ubuntu-Linux-Step-17.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/8/87/Install-Oracle-Java-on-Ubuntu-Linux- Step-17.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-17.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight” :546,”licensing”:”<div class=”mw-parser-output”></div>”}
Execute the following command.

  • Type/Copy/Paste: sudo mkdir -p /opt/google/chrome/plugins
    • Here is the command to create the directory /opt/google/chrome/plugins
  • Type/Copy/Paste: cd /opt/google/chrome/plugins
    • This is the command that takes you into the google chrome plugin directory, make sure you go into the directory before creating the icon link.
  • Type/Copy/Paste: sudo ln -s /usr/local/java/jre1.7.0_45/lib/ amd64 / libnpjp2.so
    • This is the command to create a symbolic link from the Java JRE (Java Runtime Environment) plugin libnpjp2.so to the Google Chrome browser.

Remind:

Image titled Install Oracle Java on Ubuntu Linux Step 18

Image titled Install Oracle Java on Ubuntu Linux Step 18

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/b/ba/Install-Oracle-Java-on-Ubuntu-Linux-Step-18.jpg/v4-728px-Install-Oracle- Java-on-Ubuntu-Linux-Step-18.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/b/ba/Install-Oracle-Java-on-Ubuntu-Linux- Step-18.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-18.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight” :546,”licensing”:”<div class=”mw-parser-output”></div>”}
Note: When executing the above commands, sometimes you get the following message:

  • ln: creating symbpic link `./libnpjp2.so’: File exists
  • To fix this problem, simply remove the previous link with 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 executing the command.
Image titled Install Oracle Java on Ubuntu Linux Step 19

Image titled Install Oracle Java on Ubuntu Linux Step 19

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/a/af/Install-Oracle-Java-on-Ubuntu-Linux-Step-19.jpg/v4-728px-Install-Oracle- java-on-Ubuntu-Linux-Step-19.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/a/af/Install-Oracle-Java-on-Ubuntu-Linux- Step-19.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-19.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight” :546,”licensing”:”<div class=”mw-parser-output”></div>”}
Restart the web browser and go to Java Tester to check if Java is working or not.

Mozilla Firefox

Oracle Java 32-bit Tutorial:

  • Image titled Install Oracle Java on Ubuntu Linux Step 20

    Image titled Install Oracle Java on Ubuntu Linux Step 20

    {“smallUrl”:”https://www.wikihow.com/images_en/thumb/9/99/Install-Oracle-Java-on-Ubuntu-Linux-Step-20.jpg/v4-728px-Install-Oracle- Java-on-Ubuntu-Linux-Step-20.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/9/99/Install-Oracle-Java-on-Ubuntu-Linux- Step-20.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-20.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight” :546,”licensing”:”<div class=”mw-parser-output”></div>”}
    Execute the following command.

    • Type/Copy/Paste: cd /usr/lib/mozilla/plugins
      • This is the command that takes you to the plugin directory /usr/lib/mozilla/plugins, create this directory if not already there.
    • Type/Copy/Paste: sudo mkdir -p /usr/lib/mozilla/plugins
      • Here is the command to create the directory /usr/lib/mozilla/plugins, make sure you are in the directory before creating the symbolic link.
    • Type/Copy/Paste: sudo ln -s /usr/local/java/jre1.7.0_45/lib/ i386 / libnpjp2.so
      • This is the command to create a symbolic link from the Java JRE(Java Runtime Environment) plugin libnpjp2.so to the Mozilla Firefox web browser.
    READ More:   How to Open SQL File
  • Oracle Java 64-bit Tutorial:

  • Image titled Install Oracle Java on Ubuntu Linux Step 22

    Image titled Install Oracle Java on Ubuntu Linux Step 22

    {“smallUrl”:”https://www.wikihow.com/images_en/thumb/3/35/Install-Oracle-Java-on-Ubuntu-Linux-Step-22.jpg/v4-728px-Install-Oracle- Java-on-Ubuntu-Linux-Step-22.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/3/35/Install-Oracle-Java-on-Ubuntu-Linux- Step-22.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-22.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight” :546,”licensing”:”<div class=”mw-parser-output”></div>”}
    Execute the following command:

    • Type/Copy/Paste: cd /usr/lib/mozilla/plugins
      • This is the command that takes you to the /usr/lib/mozilla/plugins directory, create this directory if it’s not already there.
    • Type/Copy/Paste: sudo mkdir -p /usr/lib/mozilla/plugins
      • Here is the command to create the directory /usr/lib/mozilla/plugins, make sure you are in the directory before creating the symbolic link.
    • Type/Copy/Paste: sudo ln -s /usr/local/java/jre1.7.0_45/lib/ amd64 / libnpjp2.so
      • This is the command to create a symbolic link from the Java JRE(Java Runtime Environment) plugin libnpjp2.so to the Mozilla Firefox web browser.
  • Remind:

    Image titled Install Oracle Java on Ubuntu Linux Step 23

    Image titled Install Oracle Java on Ubuntu Linux Step 23

    {“smallUrl”:”https://www.wikihow.com/images_en/thumb/9/94/Install-Oracle-Java-on-Ubuntu-Linux-Step-23.jpg/v4-728px-Install-Oracle- Java-on-Ubuntu-Linux-Step-23.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/9/94/Install-Oracle-Java-on-Ubuntu-Linux- Step-23.jpg/v4-728px-Install-Oracle-Java-on-Ubuntu-Linux-Step-23.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight” :546,”licensing”:”<div class=”mw-parser-output”></div>”}
    Note: Sometimes you execute the above commands and get the message:

    • ln: creating symbpic link `./libnpjp2.so’: File exists
    • To fix this problem, simply remove the previous link with 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 executing the command.
  • Restart the web browser and visit the Java Tester page to check if Java is working in the browser.
  • Advice

    • With Ubuntu Linux, you can choose between OpenJDK, the free, open source Java programming language; or Oracle Java JDK and JRE. Some people prefer to use Oracle Java (because it is the most up-to-date version of Java and comes from the maintainers of Java technology) but also different.
    • Please keep in mind that Oracle upgrades security, fixes bugs, and improves performance with each Oracle Java update. When installing Oracle Java on your system, pay attention to the version number. Refer to more articles on how to upgrade Oracle Java on Linux.
    • Note that this article is constantly revised because Oracle sometimes changes the method of installing the Java JDK/JRE binary.
    X

    wikiHow is a “wiki” site, which means that many of the articles here are written by multiple authors. To create this article, 35 people, some of whom are anonymous, have edited and improved the article over time.

    This article has been viewed 10,730 times.

    This article will guide to install Oracle Java 7 32-bit and 64-bit (current version is 1.7.0_45 ) JDK/JRE on 32-bit and 64-bit Ubuntu operating systems. You can apply this guide to Debian and Linux Mint.

    If you have installed Oracle Java 7 on the operating system but want to upgrade, please refer to the tutorial to upgrade Oracle Java on Ubuntu Linux.

    For those who just want to install Oracle Java JRE to run Java applications and not develop Java programs, please refer to the tutorial on installing Oracle Java JRE on Ubuntu Linux.

    For those who want to install Oracle Java JDK to develop Java programs and applications (Oracle Java JRE includes Oracle JDK), use the following method:

    • How to Install Oracle Java JDK on Ubuntu Linux

    To activate/upgrade Oracle Java on a web browser, refer to the tutorial on activating Oracle Java on a web browser.

    Thank you for reading this post How to Install Oracle Java on Ubuntu Linux at Tnhelearning.edu.vn You can comment, see more related articles below and hope to help you with interesting information.

    Related Search:

    Related Posts

    How to Create Curved Text in Photoshop
    How to fall asleep faster
    How to Install FBReader to Read eBooks

    Category: How To

    Previous Post: « How to Meet Adult Movie Actors in Real Life
    Next Post: How to Kill Chipmunks »

    Copyright © 2025 · Tnhelearning.edu.vn - Useful Knowledge