You likely don't have the i386 architecture enabled. Do the following:
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install openjdk-11-jdk:i386
Answer from popey on askubuntu.comJava 11 installation problem for Ubuntu 16.04 - Stack Overflow
Problem installing openjdk-11-jdk
java - How to install JDK 11 under Ubuntu? - Stack Overflow
How do you manually install java openjdk?
To install OpenJDK 11 in Ubuntu, use the commands listed below.
- Add the repository
sudo add-apt-repository ppa:openjdk-r/ppa
- Update package list
sudo apt-get update
- Install
openjdk-11-jdk
sudo apt install openjdk-11-jdk
I had this error while building a Dockerfile. The solution was to install default-jre instead:
sudo apt-get install -y default-jre
Just do this after installing,
sudo nano /etc/environment
JAVA_HOME="/usr/lib/jvm/jdk-11.0.8"
Note that, /bin is not to be included. Save and exit. Then,
source /etc/environment
Btw, why complicate a normal installation?
You can probably install java 11 by the following command
sudo add-apt-repository ppa:linuxuprising/java
sudo apt-get update
sudo apt-get install openjdk-11-jdk
You can refer this link to see how to install openjdk 11 on ubuntu.
Then you can run the
update-alternatives --config java
to update the java version. You can refer this link to see how to update java alternatives.
I am trying to install Ghidra on a newly spun up Debian machine. When I run sudo apt-get install -y openjdk-11-jdk it fails with E: Unable to locate package openjdk-11-jdk. When I run java -version, it says I am running version 16.0.1. How do i revert to the openjkd-11? Or is something else going on that's wrong?
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
If you want to install OpenJDK 11, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt install openjdk-11-jdk
Source:1.
Here is an explanation of the confusing name of the package.
The Ubuntu Foundation Team made an SRU exception for OpenJDK. Although version 10 is a non-LTS release, they've packaged it as openjdk-11-jdk until OpenJDK 11 goes GA. This choice was based on that assumption that there is a much smaller interface delta between releases 10 and 11 than it would be between 8 and 11.
That's a fairly good reasoning and perhaps an apt-get upgrade wouldn't screw things up that badly when OpenJDK's version gets bumped up from 10 to 11.