tl;dr:
You might want an older Java than 11(tutorial for that). If you do, click through here to install Oracle Java 8. Note that the license has changed.
Reason(s) to need that
My recent Ubuntu (as of July 28th, 2019)
uses the Java version 11 which is currently not supported by JabRef
(Source)
and I needed to use JabRef - this might apply to other software as well.
Therefore I issued
sudo add-apt-repository ppa:webupd8team/java
as found in the op's link and other answers, including the still accepted one, which for me led to:
[long explanation you get see below]
For this reason, THIS PPA IS DISCONTINUED (unless I find some way around this limitation).
Solution
The workaround that went well for my case was to
install a supported version of Java (7 or 8) via Oracle's website
(See here → Introduction/2. Oracle Java - thanks to pang for fixing the broken link)
To do so, click through to this site, download the respective fitting file and follow the given Instructions.
I unfortunately found no other way than calling it with the absolute path, but this works. In my case for example
cd /usr/java/jre1.8.0_221/bin/
./java -jar ~/bin/JabRef.dir/JabRef-4.3.1.jar #or where your .jar file lies
If Java 11 is not a problem for you, you probably want to use this tutorial.
(Thanks to Saleh Enam Shohag for the comment)
[long explanation]
The Oracle JDK License has changed for releases starting April 16,
2019.
The new Oracle Technology Network License Agreement for Oracle Java SE
is substantially different from prior Oracle JDK licenses. The new
license permits certain uses, such as personal use and development
use, at no cost -- but other uses authorized under prior Oracle JDK
licenses may no longer be available. Please review the terms carefully
before downloading and using this product. An FAQ is available here:
https://www.oracle.com/technetwork/java/javase/overview/oracle-jdk-faqs.html
Oracle Java downloads now require logging in to an Oracle account to
download Java updates, like the latest Oracle Java 8u211 / Java SE
8u212. Because of this I cannot update the PPA with the latest Java
(and the old links were broken by Oracle).
For this reason, THIS PPA IS DISCONTINUED (unless I find some way
around this limitation).
Oracle Java (JDK) Installer (automatically downloads and installs
Oracle JDK8). There are no actual Java files in this PPA.
Important -> Why Oracle Java 7 And 6 Installers No Longer Work:
http://www.webupd8.org/2017/06/why-oracle-java-7-and-6-installers-no.html
Update: Oracle Java 9 has reached end of life:
http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html
The PPA supports Ubuntu 18.10, 18.04, 16.04, 14.04 and 12.04.
More info (and Ubuntu installation instructions):
Debian installation instructions:
For Oracle Java 11, see a different PPA ->
https://www.linuxuprising.com/2019/06/new-oracle-java-11-installer-for-ubuntu.html
More info: https://launchpad.net/~webupd8team/+archive/ubuntu/java