Amazon offers an open jdk for Windows (and other OS), but just for Java 8, 11 and 16. You can download it from here: https://aws.amazon.com/es/corretto/
After installing it and running the java -version command, you will see something like this:
>java -version openjdk version "1.8.0_242" OpenJDK Runtime Environment Corretto-8.242.08.1 (build 1.8.0_242-b08) OpenJDK 64-Bit Server VM Corretto-8.242.08.1 (build 25.242-b08, mixed mode)Answer from Manuel Domínguez on Stack Overflow
Why is it so hard to install jdk 8 on kali?
java - How to install openJdk 8 in windows 64 bit os - Stack Overflow
How to install java 8 JRE & JDK?
How to install Oracle JDK 8 in opensuse tumbleweed?
Videos
Hi, I have a kali running on a virtualbox vm, and I need to run a program which requires me to have java 8.
Trying to run:
sudo apt install openjdk-8-jdk
Simply results in kali not being able to find it. I the learned that this is because kali does not include java 8 in it's gettable packages.
I tried to google me out of this, and then tried running sudo add-apt-repository ppa:webupd8team/java Which it couldnt find the command for. I tried also fixing that with updating and sudo apt install software-properties-common, that package can not be found either.
Then I check out a video like this, but it uses a defunct link for getting the jdk 8.
I can also find shady -looking sites like these, with binaries that I am afraid of dowloading.
Finally I managed to get my hand on a folder containing jdk8. but I have absolutely no idea how to install it.
Can someone help me, point me in the right direction? and maybe also explain why java 8 is so hard to get installed, when it's so widely used?
Another attempt:
I also tried folliowing this guide.
This one fails when I run wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add - because apt-key is deprecated.
Later on, the package adoptopenjdk-8-hotspot cannot be found
Amazon offers an open jdk for Windows (and other OS), but just for Java 8, 11 and 16. You can download it from here: https://aws.amazon.com/es/corretto/
After installing it and running the java -version command, you will see something like this:
>java -version openjdk version "1.8.0_242" OpenJDK Runtime Environment Corretto-8.242.08.1 (build 1.8.0_242-b08) OpenJDK 64-Bit Server VM Corretto-8.242.08.1 (build 25.242-b08, mixed mode)
The best way to do this is to use the builds from adoptopenjdk. They're very high quality and come in multiple variants for Windows ranging from zip files to MSI installers. Dead simple to install JDK 8, 11 or 15.
But, after the installation when I tried checking the version using command java -version it's showing like regular JDK.
This is because JAVA_HOME is pointing to your old JDK. You need to go to Control Panel and change the Environment Variables. Just do a search on Windows 10 for "Environment Variables" to easily find that configuration panel.
In my case there's a Java process running (JDK 7). I just terminated that process and Java installer completed installation. In order to do it follow these steps.
- Open task manager.
- Find-out Java SE Binary process running.
- Right click on it and end task or use Alt + E
- Now Java installer completes installation.
Hope it'll be helpful.
I found that I thought I had this problem, and actually, there was a window that had popped up on another screen that required me to hit "next". If anyone else is having this issue I'd check to make sure that there isn't a popup behind one of your other windows.
Usually you install the openjdk like this:
sudo apt-get install openjdk-8-jdk
Maybe this is the problem. You can look this up at http://openjdk.java.net/install/index.html. If you do this you might have fixed this problem. But cant imagine why your command give this result.
I installed oracle-jdk8. If you need,
sudo add-apt-repository ppa:webupd8team/java && sudo apt update
sudo apt install oracle-java8-installer