How To Install Java Tar File In Linux
Following is a footstep by stride guide to install Java on Linux. In this training, we will install Java on Ubuntu. The procedure and install commands remain the same, for different flavors of Linux, or versions of Java.
How to Install Oracle Java on Ubuntu Linux
Step 1) Earlier you beginning with the setting upwardly Java, yous will demand to remove the OpenJDK/JRE from the system.
To do this, use below control-
sudo apt-go purge openjdk-\*
You volition be asked for a confirmation. Enter Y
Await for quondam for uninstall to complete
Footstep 2) Check whether Ubuntu OS architecture is 32-fleck or 64-flake.
You can do it using the following command-
file /sbin/init
Step 3) Download latest Coffee (a zip file e.1000., jdk-eight-linux-x64.tar.gz) from Oracle site-
https://www.oracle.com/java/technologies/javase-downloads.html
Accept the License Agreement.
- Select x86 for 32-bit system
- Select x64 for 64-chip system
- Select the tar.gz for Ubuntu
-
Select rpm for Debian based organization
Once a download is complete y'all will run across
Stride four) In the concluding, navigate to the location of your zip file
Extract contents of java nothing file in a directory of your choice.
In this tutorial, nosotros will extract in the Downloads folder itself –
sudo tar -xvf jdk-8u5-linux-i586.tar.gz
Enter your password, if asked. The unzip will proceed. Once done you will see the following binder –
Step five) Add together the following system variables to the end of /etc/profile file
JAVA_HOME=<Directory where JAVA has been extracted>/jdk1.viii.0 PATH=$PATH:$HOME/bin:$JAVA_HOME/bin consign JAVA_HOME export PATH
To do so –
Enter command
"sudo nano /etc/profile"
Enter the arrangement variables
Press Command+C to enter into control fashion
Press ^+X to Exit
Press "Y" to save the changes
Step 6) At present reload surround using a command,
. /etc/profile
Step vii) Its time to let Ubuntu know where our JDK/JRE is located.
Copy-paste below lines into a command prompt.
sudo update-alternatives --install "/usr/bin/java" "java" "<Directory where Coffee has been extracted>/bin/java" 1 sudo update-alternatives --install "/usr/bin/javac" "javac" "<Directory where JAVA has been extracted>/bin/javac" 1 sudo update-alternatives --install "/usr/bin/javaws" "javaws" "<Directory where JAVA has been extracted>/bin/javaws" 1
Footstep 8) Tell Ubuntu that our installation i.eastward., jdk1.8.0_05 must be the default Java.
Use below commands to practice this-
sudo update-alternatives --set java <Directory where Coffee has been extracted>/bin/java sudo update-alternatives --set javac <Directory where Coffee has been extracted>/bin/javac sudo update-alternatives --fix javaws <Directory where JAVA has been extracted>/bin/javaws
Step ix) Test the installation using below command,
java -version
A successful installation will show information equally seen in the above screenshot.
Source: https://www.guru99.com/how-to-install-java-on-ubuntu.html
Posted by: laneagnection1944.blogspot.com

0 Response to "How To Install Java Tar File In Linux"
Post a Comment