java tutorial - How to install Java on Linux - java programming - learn java - java basics - java for beginners
Install JAVA on Linux Systems
- The Java can be installed and running on same computer as well as it’s possible to have different version of JDK and JRE at the same time on a machine, actually there are abundant of applications that requires Java-jre (Java Runtime Environment) and those who are developer required Java-sdk (Software Development Kit).
- Many of Linux distribution comes under additional version of Java known as OpenJDK (not the one developed by Sun Microsystems and then acquired by Oracle Corporation).
- The OpenJDK is open source implementation of Java application.
Steps to Install Java in Linux
Step 1
- Before installing Java, make sure to initial verify the version of installed Java.
- It’s clear from the output above that the installed version of Java is OpenJDK 1.7.0_75.
Step 2
- Make a directory where you want to install Java. For global access (for all users) install it preferably in the directory /opt/java.
/opt/java.
Step 3
- Now download Java (JDK) 8u45 source tarball files for your system architecture by going to official Java download page.
- For reference, we have provided the source tarball file-names, please select and download these under mentioned files only.
- Otherwise, you may use wget command to download files directly into the
/opt/java
directory as shown below.
Step 4
- Once file has been downloaded, you may extract the tarball using tar command as shown below.
Step 5
- From that point onwards, move to the already extracted directory and to utilize command update-alternatives then to inform system where java as well as its executables are installed.
Learn Java - Java tutorial - Update java alternatives - Java examples - Java programs
Step 6
- System to update javac alternatives as,
Learn Java - Java tutorial - Update javac alternatives 1 - Java examples - Java programs
Step 7
- Likewise, update jar alternatives as:
Learn Java - Java tutorial - Update Jar Alternatives - Java examples - Java programs
Step 8
- Now you have to setting up Java Environment Variables.
Learn Java - Java tutorial - Set Java Path - Java examples - Java programs
Step 9
- Presently you can check the Java version another time, to confirm.
- Optional: If you are not using OpenJDK (open source implementation of java), you may eliminate it as:
Enable Java Support in Firefox
Step 10
- To enable Java 8 JDK 8u45 Support in Firefox, you require running the following commands to allow Java module for Firefox.
On Debian, Ubuntu and Mint
On RHEL, CentOS and Fedora
Step 11
- Finally verify the Java support by restart the Firefox and enter about:plugins on the address bar. You will get similar to below screen.
Learn Java - Java tutorial - Java support in firefox - Java examples - Java programs