How to install specific version of java - java

My current java version is 11.0.12 . I want to install 11.0.13 so I tried with update-alternatives --config java but there is no 13 version.
I also check with installable java version by apt search "OpenJDK" , it show
openjdk-11-jdk 11.0.12
openjdk-8-jdk 8u312
So I don't know how to find 11.0.13 installer package ?
PS - I don't want to install by local downloaded file.

update-alternatives --config java command only works when you have different Java major versions installed in different paths, such as a jdk8 and an 11.
Try updating your repository with sudo apt update and then check with apt list openjdk-11-jdk.
What version of Ubuntu do you have?

Related

OpenJDK 1.8.0 installs jre but not jdk?

I found this older post: sudo yum install installs only JRE not JDK - Centos
But when I ran sudo yum install java-1.8.0-openjdk-devel I don't see the jdk installed?
I checked;
$ sudo alternatives --config java
There is 1 program that provides 'java'.
Selection Command
*+ 1 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-2.el8_5.x86_64/jre/bin/java)
I do devops, not a developer but the devs asked for me to finish the install and get jdk on there, any advice?
Thanks!
The JDK should be installed after installing this package, you can check with:
sudo alternatives --config javac
The JRE is just installed inside the /jre subdirectory.

How to install JDK 11 under Ubuntu?

So Java 11 is out. Does anybody know how to install it (OpenJDK from Oracle) from the command line?
I would like to see something like it was before for Oracle Java 10:
sudo add-apt-repository ppa:linuxuprising/java
sudo apt-get update
sudo apt-get install oracle-java10-installer
P. S. In the similar question proposed instruction:
sudo apt-get install openjdk-11-jdk
doesn't work.
Now it is possible to install openjdk-11 this way:
sudo apt-get install openjdk-11-jdk
(Previously it installed openjdk-10, but not anymore)
To install Openjdk 11 in Ubuntu, the following commands worked well.
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt install openjdk-11-jdk
sudo apt-get install openjdk-11-jdk
after this, try
java -version
to make sure java version is 1.11.x, if found old one or different, check below command to see the available jdks,
update-java-alternatives --list
you should see something like below,
java-1.11.0-openjdk-amd64 1111 /usr/lib/jvm/java-1.11.0-openjdk-amd64
java-1.8.0-openjdk-amd64 1081 /usr/lib/jvm/java-1.8.0-openjdk-amd64
you can see java 1.11 available from above list, use below command to set java 11 to default,
sudo update-alternatives --config java
for above command, you will get something like below and also, will ask for an option to set,
There are 3 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
*2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
3 /usr/lib/jvm/jdk1.8.0_211/bin/java 0 manual mode
Press <enter> to keep the current choice[*], or type selection number:
you can select desired selection number, my case it's 0
for javac,
sudo update-alternatives --config javac
will result something like below,
There are 3 choices for the alternative javac (providing /usr/bin/javac).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-11-openjdk-amd64/bin/javac 1111 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/javac 1111 manual mode
*2 /usr/lib/jvm/java-8-openjdk-amd64/bin/javac 1081 manual mode
3 /usr/lib/jvm/jdk1.8.0_211/bin/javac 0 manual mode
Press <enter> to keep the current choice[*], or type selection number:
in my case, it's 0 again
after above steps, try
java -version
it will display something like below,
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment (build
11.0.4+11-post-Ubuntu-1ubuntu218.04.3)
OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3, mixed > mode, sharing)
For anyone running a JDK on Ubuntu and want to upgrade to JDK11, I'd recommend installing via sdkman. SDKMAN is a tool for switching JVMs, removing and upgrading.
SDKMAN is a tool for managing parallel versions of multiple Software Development Kits on most Unix based systems. It provides a convenient Command Line Interface (CLI) and API for installing, switching, removing and listing Candidates.
Install SDKMAN
$ curl -s "https://get.sdkman.io" | bash
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
$ sdk version
Install Java (11.0.3-zulu)
$ sdk install java
In Ubuntu, you can simply install Open JDK by following commands.
sudo apt-get update
sudo apt-get install default-jdk
You can check the java version by following the command.
java -version
If you want to install Oracle JDK 8 follow the below commands.
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
If you want to switch java versions you can try below methods.
vi ~/.bashrc and add the following line export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_221 (path/jdk folder)
or
sudo vi /etc/profile and add the following lines
#JAVA_HOME=/usr/lib/jvm/jdk1.8.0_221
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME
export JRE_HOME
export PATH
You can comment on the other version. This needs to sign out and sign back in to use. If you want to try it on the go you can type the below command in the same terminal. It'll only update the java version for a particular terminal.
source /etc/profile
You can always check the java version by java -version command.
First check the default-jdk package, good chance it already provide you an OpenJDK >= 11.
ref: https://packages.ubuntu.com/search?keywords=default-jdk&searchon=names&suite=all&section=all
Ubuntu 18.04 LTS +
So starting from Ubuntu 18.04 LTS it should be ok.
sudo apt update -qq
sudo apt install -yq default-jdk
note: don't forget to set JAVA_HOME
export JAVA_HOME=/usr/lib/jvm/default-java
mvn -version
Ubuntu 16.04 LTS
For Ubuntu 16.04 LTS, only openjdk-8-jdk is provided in the official repos so you need to find it in a ppa:
sudo add-apt-repository -y ppa:openjdk-r/ppa
sudo apt update -qq
sudo apt install -yq openjdk-11-jdk
note: don't forget to set JAVA_HOME
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
mvn -version
I had problems installing open jdk on ubuntu 17.04
I managed to install it using this steps:
wget https://download.java.net/java/ga/jdk11/openjdk-11_linux-x64_bin.tar.gz -O /tmp/openjdk-11+28_linux-x64_bin.tar.gz
tar xfvz /tmp/openjdk-11+28_linux-x64_bin.tar.gz --directory /usr/lib/jvm/
rm /etc/alternatives/java
ln -s /usr/lib/jvm/jdk-11/bin/java /etc/alternatives/java
java -version
You should see this:
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
I came here looking for the answer and since no one put the command for the oracle Java 11 but only openjava 11 I figured out how to do it on Ubuntu, the syntax is as following:
sudo add-apt-repository ppa:linuxuprising/java
sudo apt update
sudo apt install oracle-java11-installer
I created a Bash script that basically automates the manual installation described in the linked similar question. It requires the tar.gz file as well as its SHA256 sum value. You can find out more info and download the script from my GitHub project page. It is provided under MIT license.
Just updated older Ubuntu versions to openJDK 11Actually I need it for Jenkins only and it seems to work fine.
Ubuntu 12.04 (Precise):
Download from openjdk-lts (11.0.4+11-1~12.04) precise
Files:
openjdk-11-jre-headless_11.0.4+11-1~12.04_amd64.deb
openjdk-11-jre_11.0.4+11-1~12.04_amd64.deb
Ubuntu 14.04 (Trusty):
Download from openjdk-lts (11.0.5+10-2ubuntu1~14.04) trusty
Files:
openjdk-11-jre-headless_11.0.5+10-2ubuntu1_14.04_amd64.deb
openjdk-11-jre_11.0.5+10-2ubuntu1_14.04_amd64.deb
Installation
After download I installed the files with Ubuntu Software Center ("headless" first!)
Then I selected the new version with sudo update-alternatives --config java
I didn't have to change any environment variables (like JAVA_HOME) - maybe Jenkins doesn't care about them...
if you want to use official oracle jdk.
then download jdk 11 or latest from oracle website: https://www.oracle.com/java/technologies/javase-downloads.html
then use this command to install :
sudo dpkg -i the file you downloaded
then add to your PATH using /etc/profile file.
in my case it's just worked 100% using ubuntu 20.04
note: official oracle jdk free only for developments.
Following are command to install openjdk 11
sudo apt-get install openjdk-11-jdk
We can check the version by running following command
java -version
For setting the JAVA_HOME in path we can following command
sudo gedit .bashrc.
Set the following value in bashrc file
export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))
export PATH=$PATH:$JAVA_HOME/bin
To execute the content of bashrc file run following command
source ~/.bashrc.

Downgrade open jdk 8 to 7 in ubuntu 14.04

I accidentally upgraded the whole system in ubuntu 14.04.
I am trying to deploy a war file which requires JDK7.
I tried to install JDK7 and use it as default
root:floyd~# update-alternatives --config java
There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
Nothing to configure.
but it is not installing as well. It gives following error while trying to install JDK 7.
root#floyd:~# apt-get install openjdk-7-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package openjdk-7-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
N: Ignoring file '50unattended-upgrades.ucf-dist' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
E: Package 'openjdk-7-jdk' has no installation candidate
I guess I have two options.
Install JDK7 and use it as default.
Downgrade JDK8 to JDK7.
I think downgrading can be a good option but I am not able to do any of them.
Installing JRE/JDK in default configuration
OpenJDK 7 is installed as default in Ubuntu 12.10 and later.
Installing Java whereby apt-get is easy:
sudo apt-get update
java -version
If after execution we have something like: "The program java can be found in the following packages", it means that Java isn't installed. So, we need to to:
sudo apt-get install default-jre
As result, Java Runtime Environment (JRE) will be installed. When we want to install Java Development Kit (JDK), which is needed for compilling Java-app (for example, Apache Ant, Apache Maven, Eclipse and IntelliJ IDEA) we need to do:
sudo apt-get install default-jdk
Now, Java is installed.
Installing OpenJDK 7 (optionally)
sudo apt-get install openjdk-7-jre
After execution Java Runtime Environment (JRE) will be installed. For Java Development Kit (JDK), we execute:
sudo apt-get install openjdk-7-jdk
Installing Oracle JDK (optionally)
Oracle JDK is an official JDK but, now, Oracle doesn't support it like default for installation in Ubuntu.
We can install it by apt-get but before we need to execute next commands:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
Later, we have to choose needed version and execute:
For Oracle JDK 6
sudo apt-get install oracle-java6-installer
For Oracle JDK 7
sudo apt-get install oracle-java7-installer
For Oracle JDK 8
sudo apt-get install oracle-java8-installer
For Oracle JDK 9
sudo apt-get install oracle-java9-installer
Managing of Java (optionally)
When we have some version Java installed we can choose one of them as default:
sudo update-alternatives --config java
As result we will see something like this:
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-7-oracle/jre/bin/java 1062 auto mode
1 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-7-oracle/jre/bin/java 1062 manual mode
Press enter to keep the current choice[*], or type selection number:
We can see it on the screen:
The same action we can do to choose the compiler (javac):
sudo update-alternatives --config javac
This command can be used to choose other java componenst, for example, like: keytool, javadoc and jarsigner.
Installing "JAVA_HOME"
To be installed **JAVA_HOME**:
sudo update-alternatives --config java
Result like:
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-7-oracle/jre/bin/java 1062 auto mode
1 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-7-oracle/jre/bin/java 1062 manual mode
Press enter to keep the current choice[*], or type selection number:
As we can see the paths for java will be:
/usr/lib/jvm/java-7-oracle
/usr/lib/jvm/java-6-openjdk-amd64
/usr/lib/jvm/java-7-oracle
Now, we need to copy one of the ways and paste it into:
/etc/environment:
sudo nano /etc/environment
In the file we are going to add a path(where YOUR_PATH - is path for desired version of java, for example: "/usr/lib/jvm/java-7-oracle"):
JAVA_HOME="/usr/lib/jvm/java-7-oracle"
On the screen:
Now, we need to reboot this file:
source /etc/environment
To check it we can:
echo $JAVA_HOME
On the screen:
When we have, now, input way("/usr/lib/jvm/java-7-oracle" in our example) it will be means we do it sucessfully. In other way we need to be more attentive and check all these steps once.

Installing Java 7 on Ubuntu

Note: This question was asked before Oracle made the OpenJDK the free version of the Oracle JDK, and the historic answers reflect that. As of 2022 you should not use Java 7 unless you must for projects which cannot run on OpenJDK 8.
To install java I have always used the classic way from the terminal.
I would like to install java manually.
I placed the folder of the JDK on the desk and I set environment variables (PATH, CLASSPATH and JAVA_HOME).
From the terminal, if I type java -version I get printed
foralobo#ubuntu-vincy:~$ java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
But when I try to install eclipse or netbeans, the system warns by saying that there is no java installed on the machine.
What is missing to compleatare manual installation?
(Ubuntu 13.04)
This answer used to describe how to install Oracle Java 7. This no longer works since Oracle end-of-lifed Java 7 and put the binary downloads for versions with security patches behind a paywall. Also, OpenJDK has grown up and is a more viable alternative nowadays.
In Ubuntu 16.04 and higher, Java 7 is no longer available. Usually you're best off installing Java 8 (or 9) instead.
sudo apt-get install openjdk-8-jre
or, f you also want the compiler, get the jdk:
sudo apt-get install openjdk-8-jdk
In Trusty, the easiest way to install Java 7 currently is to install OpenJDK package:
sudo apt-get install openjdk-7-jre
or, for the jdk:
sudo apt-get install openjdk-7-jdk
If you are specifically looking for Java 7 on a version of Ubuntu that no longer supports it, see https://askubuntu.com/questions/761127/how-do-i-install-openjdk-7-on-ubuntu-16-04-or-higher .
sudo apt-get update
sudo apt-get install openjdk-7-jdk
and if you already have other JDK versions installed
sudo update-alternatives --config java
then select the Java 7 version.
In addition to flup's answer you might also want to run the following to set JAVA_HOME and PATH:
sudo apt-get install oracle-java7-set-default
More information at:
http://www.ubuntuupdates.org/package/webupd8_java/precise/main/base/oracle-java7-set-default
Note: According to comments this text was copied from a GIST without attribution.
Download java jdk<version>-linux-x64.tar.gz file from https://www.oracle.com/technetwork/java/javase/downloads/index.html.
Extract this file where you want. like: /home/java(Folder name created by user in home directory).
Now open terminal.
Set path JAVA_HOME=path of your jdk folder(open jdk folder then right click on any folder, go to properties then copy the path using select all)
and paste here.
Like: JAVA_HOME=/home/xxxx/java/JDK1.8.0_201
Let Ubuntu know where our JDK/JRE is located.
sudo update-alternatives --install /usr/bin/java java /home/xxxx/java/jdk1.8.0_201/bin/java 20000
sudo update-alternatives --install /usr/bin/javac javac /home/xxxx/java/jdk1.8.0_201/bin/javac 20000
sudo update-alternatives --install /usr/bin/javaws javaws /home/xxxx/java/jdk1.8.0_201/bin/javaws 20000
Tell Ubuntu that our installation i.e., jdk1.8.0_05 must be the default Java.
sudo update-alternatives --set java /home/xxxx/sipTest/jdk1.8.0_201/bin/java
sudo update-alternatives --set javac /home/xxxx/java/sipTest/jdk1.8.0_201/bin/javac
sudo update-alternatives --set javaws /home/xxxxx/sipTest/jdk1.8.0_201/bin/javaws
Now try:
$ sudo update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-6-oracle1/bin/java 1047 auto mode
1 /usr/bin/gij-4.6 1046 manual mode
2 /usr/lib/jvm/java-6-oracle1/bin/java 1047 manual mode
3 /usr/lib/jvm/jdk1.7.0_75/bin/java 1 manual mode
Press enter to keep the current choice [*], or type selection number: 3
update-alternatives: using /usr/lib/jvm/jdk1.7.0_75/bin/java to provide /usr/bin/java (java) in manual mode
Repeat the above for:
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
I think you should consider Java installation procedure carefully. Following is the detailed process which covers almost all possible failures.
Installing Java with apt-get is easy. First, update the package index:
sudo apt-get update
Then, check if Java is not already installed:
java -version
If it returns "The program java can be found in the following packages", Java hasn't been installed yet, so execute the following command:
sudo apt-get install default-jre
You are fine till now as I assume.
This will install the Java Runtime Environment (JRE). If you instead need the Java Development Kit (JDK), which is usually needed to compile Java applications (for example Apache Ant, Apache Maven, Eclipse and IntelliJ IDEA execute the following command:
sudo apt-get install default-jdk
That is everything that is needed to install Java.
Installing OpenJDK 7:
To install OpenJDK 7, execute the following command:
sudo apt-get install openjdk-7-jre
This will install the Java Runtime Environment (JRE). If you instead need the Java Development Kit (JDK), execute the following command:
sudo apt-get install openjdk-7-jdk
Installing Oracle JDK:
The Oracle JDK is the official JDK; however, it is no longer provided by Oracle as a default installation for Ubuntu.
You can still install it using apt-get. To install any version, first execute the following commands:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
Then, depending on the version you want to install, execute one of the following commands:
Oracle JDK 7:
sudo apt-get install oracle-java7-installer
Oracle JDK 8:
sudo apt-get install oracle-java8-installer
PPA method no longer works.
While Oracle Java 6 and 7 are not supported for quite a while, they were still available for download on Oracle's website until recently.
However, the binaries were removed about 10 days ago (?), so the Oracle Java (JDK) 6 and 7 installers available in the WebUpd8 Oracle Java PPA no longer work.
Oracle Java 6 and 7 are now only available for those with an Oracle Support account (which is not free), so I can't support this for the PPA packages.
Source : http://www.webupd8.org/2017/06/why-oracle-java-7-and-6-installers-no.html
Dated : June 2017
Oracle's download page says
Updates for Java SE 7 released after April 2015, and updates for Java SE 6 released after April 2013 are only available to Oracle Customers through My Oracle Support (requires support login).
Java SE Advanced offers users commercial features, access to critical bug fixes, security fixes, and general maintenance".
I had to download it from Oracle archives -
http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html
You need an account for this though.
Oracle Java 1.7.0 from .deb packages
wget https://raw.github.com/flexiondotorg/oab-java6/master/oab-java.sh
chmod +x oab-java.sh
sudo ./oab-java.sh -7
sudo apt-get update
sudo sudo apt-get install oracle-java7-jdk oracle-java7-fonts oracle-java7-source
sudo apt-get dist-upgrade
Workaround for 1.7.0_51
There is an Issue 123 currently in OAB and a pull request
Here is the patched vesion:
wget https://raw.github.com/ladios/oab-java6/master/oab-java.sh
chmod +x oab-java.sh
sudo ./oab-java.sh -7
sudo apt-get update
sudo sudo apt-get install oracle-java7-jdk oracle-java7-fonts oracle-java7-source
sudo apt-get dist-upgrade
flup's answer is the best but it did not work for me completely. I had to do the following as well to get it working:
export JAVA_HOME=/usr/lib/jvm/java-7-oracle/jre/
chmod 777 on the folder
./gradlew build - Building Hibernate
Oracle as well as modern versions of Ubuntu have moved to newer versions of Java. The default for Ubuntu 20.04 is OpenJDK 11 which is good enough for most purposes.
If you really need it for running legacy programs, OpenJDK 8 is also available for Ubuntu 20.04 from the official repositories.
If you really need exactly Java 7, the best bet as of 2020 is to download a Zulu distribution. The easiest to install if you have root privileges is the .DEB version, otherwise download the .ZIP one.
https://www.azul.com/downloads/?version=java-7-lts&os=ubuntu&architecture=x86-64-bit&package=jdk#download-openjdk
Open Applicaction -> Accessories -> Terminal
Type commandline as below...
sudo apt-get install openjdk-7-jdk
Type commandline as below...
apt-cache search jdk
(Note: openjdk-7-jdk is symbolically used here. You can choose the JDK version as per your requirement.)
For "JAVA_HOME" (Environment Variable) type command as shown below, in "Terminal" using your installation path...
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk
(Note: "/usr/lib/jvm/java-7-openjdk" is symbolically used here just for demostration. You should use your path as per your installation.)
For "PATH" (Environment Variable) type command as shown below, in "Terminal" using your installation path...
export PATH=$PATH:/usr/lib/jvm/java-7-openjdk/bin
(Note: "/usr/lib/jvm/java-7-openjdk" is symbolically used here just for demostration. You should use your path as per your installation.)
Check for "open jdk" installation, just type command in "Terminal" as shown below
javac -version

downgrade java version

I tried to downgrade java version.
If I use apt-get install sun-java6-jdk on Ubuntu, it will install java version 1.6.26 .
What I want is java 1.6.20. How can I downgrade java?
Java on Linux doesn't need to be installed as root. You can install as many different Java versions you want on Linux, either in separate user accounts or in a single account.
I do it all the time (switching from one Java version to another) to test on various versions of the JVM.
Changing your Java version can be as simple as this:
... $ which java
/home/b/jdk1.5.0_22/bin/java
... $ export PATH=/home/b/jdk1.6.0_25/bin:$PATH
... $ which java
/home/b/jdk1.6.0_25/bin/java
To fetch an old version, go to the "Oracle Java Archive" page (Google if link becomes broken):
http://www.oracle.com/technetwork/java/archive-139210.html
Then pick your poison. I download the .bin, chmod +x it and then I extract the Java version I want from the .tgz.
Then I simply set the PATH and I'm usually good to go.
I run my IDE (IntelliJ IDEA) using one Java version, I typically compile using another JDK and I test on several JVMs.
All this from the same user account.
So it's not as if you had to install "one" Java version on a Linux system...
Now, concretely, if I were you, I'd simply remove all traces from Java while being root, and then I'd download the old version I need from the Oracle Java Archive.
like tactical coder said, you can install as many versions as you want, to switch the current version just run:
sudo update-alternatives --config java
And select the desired version.
If you wish, run it for javac and javaws:
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
Source:
https://askubuntu.com/questions/56104/how-can-i-install-sun-oracles-proprietary-java-jdk-6-7-8-or-jre
Follow these steps to downgrade JAVA here[JAVA14 to JAVA8]:
sudo apt-get update
sudo apt-get install openjdk-8-jdk
sudo update-alternatives --config javac
Now Select the version of JDK
sudo update-alternatives --config java
Now Select the version of JRE
DONE
Check if it is downgraded by
java -version
You can download it from the archive section for Java SE 6.
$sudo apt-get install openjdk-8-jre (replace with the version you want to install)
$sudo update-alternatives --config java
{will get the option to choose the alternative java on your machine}
select the one you want to use as default
$java -version
Check the java version
I find Jenv to be the easiest way to switch between Java versions. You can set a Java version globally, or you can set it so that certain directories will use a specified version of Java.
See their website
once installed with Homebrew or cloned from github its as easy as:
jenv add /path/to/java1.6.20/home
jenv global 1.6.20

Categories