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:
Copy... $ 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.
Answer from TacticalCoder on Stack Overflowubuntu - downgrade java version - Stack Overflow
How to Downgrade java version in centos? - Stack Overflow
centos - How to yum downgrade to a specific version of packet like jdk? - Unix & Linux Stack Exchange
How to downgrade from java11 to java8?
Videos
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:
Copy... $ 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:
Copysudo update-alternatives --config java
And select the desired version.
If you wish, run it for javac and javaws:
Copysudo 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
Install the version you need ,
# cd /<place you want java installed>/
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/<version>/jdk-<version>-linux-x64.tar.gz"
# tar xzf jdk-<version>-linux-x64.tar.gz
Install Java with alternatives,
# cd /<place java install>/jdk1.6.0_17/
# alternatives --install /usr/bin/java java /opt/jdk1.6.0_17/bin/java 2
# alternatives --config java
Then select the version want
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
* + 1 /opt/jdk1.6.0_38/bin/java
2 /opt/jdk1.6.0_17/bin/java
Enter to keep the current selection[+], or type selection number:
Enter 2
Try downloading and installing the specific version from Java downloads, then change the Java home path.
I have spent around 2 weeks now scouring all over the web trying to find out how to install it without it giving some stupid error like "E: Unable to locate package openjdk-8-jdk" and it not getting detected by the system. I have manged to install open-java8 on sdk, but the system does not detect it. I need java8 for minecraft as older modded versions of the game are really buggy in java11 and crash at start. How can I install and downgrade to java8, and for an linux application for minecraft, be able to see it?


