• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

Install and set Java on Ubuntu 14.04 LTS with tar ball file

March 21, 2015 by Sharad Chhetri

In this tutorial we will learn , how to install and set Java on Ubuntu 14.04 LTS with tar ball. Currently on Oracle official site the .deb package is not available. We will first download the JDK tar package and then simply set the environment.

Steps to set Java environment is same with Debian, Ubuntu, RHEL, CentOS. We have already written post on setting java envinonment on RHEL/CentOS .

Step 1 : Download the Jdk package from Oracle site. As per your operating system architecture (32 or 64 bit) download the appropriate package.

Download link : Download the latest Jdk package from Oracle official site.

Java

Step 2 : Now with the help of scp transfer the downloaded jdk package into linux system.

Windows user can use winscp to transfer file into Linux system.

Step 3 : Now login into your Ubuntu / Debian system.

Step 4 : Now switch to superuser.

sudo su -

Step 5: With the help of tar command, decompress the jdk package.

Replace jdk-8u40-linux-x64.tar.gz with the jdk package name which you have downloaded.
Because of -C switch , the file will be extracted to /opt .

tar -xvzf jdk-8u40-linux-x64.tar.gz -C /opt

Step 6 : To make available the java command with latest version. We will edit /etc/profile file.

Edit the /etc/profile .

vi /etc/profile

Add the below given line at the bottom of /etc/profile file.
Note: Find the correct path of jdk file extarcted in /opt and replace it in below given lines.

export JAVA_HOME=/opt/jdk1.8.0_40/
export PATH=/opt/jdk1.8.0_40/bin:$PATH

Step 7: Now use the source command to load the Java Environment variable without system restart.

source /etc/profile

Step 8: Now check the Java version and java path.

Run the below given command to get java version.

root@localhost:~# java -version
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
root@localhost:~#

Also use the below given coomand to verify.

echo $JAVA_HOME

echo $PATH

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. Learn tar command and know about its precaution
  2. How to install Java (OpenJDK) on Ubuntu Linux
  3. NOTICE: nagios.cmd file not found. Please specify the location of this file in your /etc/vshell.conf file
  4. How to set JAVA environment variables in Linux
  5. How to create iso file from CD/DVD and how to mount .iso file in folder
  6. How to convert rpm file into deb file
  7. Convert video file into gif file through command line in linux
  8. Upgrade Ubuntu 14.04 LTS to Ubuntu 14.04.3 LTS
  9. Install pdfedit for editing pdf file in Ubuntu
  10. Give permission reference to file/dir from other file/dir in linux

Filed Under: Linux Tagged With: java

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

tr command to convert lines to space , tab and vertical tab

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

How to hide php version information in header

How to encode and decode the strings with base64

Print double hyphen sign simultaneously in post of Octopress

Could not find make anywhere!!! Please edit the config section to include the path to make. at ./install.pl line 2101

New XAMPP security concept

How to install korn shell ksh in Linux

Set GRUB password after installation of CentOS/Red Hat

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy