Referring to Ask Ubuntu question How to set JAVA_HOME for OpenJDK?,
How to install Open JDK (Java developement kit) in Ubuntu (Linux)?
Open Terminal from Application Dash or press Ctrl+Alt+T
Update repository:
sudo add-apt-repository ppa:openjdk-r/ppa # only Ubuntu 17.4 and earlier sudo apt updateOptional: To search available distributions of
openjdk, use the following command:apt search openjdkInstall the appropriate version with the following command:
sudo apt install openjdk-8-jdk sudo apt install openjdk-8-source #this is optional, the jdk source codeFor
JAVA_HOME(Environment Variable) type command as shown below, in "Terminal" using your installation path...export JAVA_HOME=/usr/lib/jvm/java-8-openjdk(Note:
/usr/lib/jvm/java-8-openjdkis symbolically used here just for demostration. You should use your path as per your installation.)For
PATH(Environment Variable) type command as shown below, inTerminal:export PATH=$PATH:$JAVA_HOME/binTo check your installation:
java -version
Referring to Ask Ubuntu question How to set JAVA_HOME for OpenJDK?,
How to install Open JDK (Java developement kit) in Ubuntu (Linux)?
Open Terminal from Application Dash or press Ctrl+Alt+T
Update repository:
sudo add-apt-repository ppa:openjdk-r/ppa # only Ubuntu 17.4 and earlier sudo apt updateOptional: To search available distributions of
openjdk, use the following command:apt search openjdkInstall the appropriate version with the following command:
sudo apt install openjdk-8-jdk sudo apt install openjdk-8-source #this is optional, the jdk source codeFor
JAVA_HOME(Environment Variable) type command as shown below, in "Terminal" using your installation path...export JAVA_HOME=/usr/lib/jvm/java-8-openjdk(Note:
/usr/lib/jvm/java-8-openjdkis symbolically used here just for demostration. You should use your path as per your installation.)For
PATH(Environment Variable) type command as shown below, inTerminal:export PATH=$PATH:$JAVA_HOME/binTo check your installation:
java -version
The following used to work before the Oracle Java license changes in early 2019.
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
The PPA is discontinued, until the author finds a workaround for the license issues.
Videos
So my current openjdk version is 11.0.23 and i needed to update it to 11.0.24.
I downloaded the package and extracted it on the system.
Then the extracted files has some bunch of folders and stuff.
How do you actually install this to the system? im using centos 7
Thanks in advance.
You can install and stay up to date with the latest Oracle Java 7 and all you have to do is manually add the PPA repository to the Software Sources.
From http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html:
su -
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get update
apt-get install oracle-java7-installer
exit
For Ubuntu, http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html. With this, I've managed to installed JDK on my ubuntu server.
Step 1: Open Applicaction>> Accessories>> Terminal
Step 2: Type commandline as below...
sudo apt-get install openjdk-6-jdk
Step 3: Type commandline as below...
apt-cache search jdk
(Note: openjdk-6-jdk is symbolically used here you can choose jdk version as per your requirment.)
How to set "Environment Variables" for "Open jdk" in Ubuntu(Linux)?
Step 4: For "JAVA_HOME" (Environment Variable) type command as shown below, in "Terminal" using your installation path...
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
(Note: "/usr/lib/jvm/java-6-openjdk" is symbolically used here just for demostration you should use your path as per your installation.)
Step 5: For "PATH" (Environment Variable) type command as shown below, in "Terminal" using your installation path...
export PATH=/usr/lib/jvm/java-6-openjdk/bin
(Note: "/usr/lib/jvm/java-6-openjdk" is symbolically used here just for demostration you should use your path as per your installation.)
Step 6: Check for "open jdk" installation, just type command in "Terminal" as shown below java
try using this command in the terminal:
sudo apt install default-jre
then you can try using:
java -version
to check version
Do not download binaries straight from the Internet. That is not how to install software on Linux. It is how Windows users do it, but it is wrong on Linux.
Install it from the package manager. Google for instructions for your version, since you did not bother to tell us what you are running. Without detailed specific info we can't help you.