Remove whatever Java and IcedTea packages/stuff you already have. I'm assuming a stock install of Ubuntu 20.04 LTS here, although 21.10 should work fine too.
First off, install the Java 11 JDK (we shouldn't need the JDK as we aren't compiling anything, but for some reason the JRE didn't work, so use the JDK regardless):
$ sudo apt update && sudo apt install openjdk-11-jdk
...
Check to make sure it is installed:
$ java --version
openjdk 11.0.13 2021-10-19
OpenJDK Runtime Environment (build 11.0.13+8-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.13+8-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)
Yay, now we have the Java 11 JRE installed (no, newer versions won't work, so you can't use 16 or 17. Java 8 works, but I prefer 11 as it supports HiDPI displays). Time to install IcedTea-Web. So... Ubuntu doesn't include it in the package repos. So the next best thing is to install it manually. Download the latest release of it from here. Specifically, you want the icedtea-web-X.Y.Z.linux.bin.zip
file. Download it, and move the zip into an (empty) folder - I used ~/icedtea
. Extract it with unzip icedtea-web-X.Y.Z.linux.bin.zip
(use the correct filename here). You may have to install it with sudo apt update && sudo apt install unzip
. Now there will be a folder called icedtea-web-image
. Go into it. Now go into the bin
folder (within icedtea-web-image
). Run this to test IcedTea-Web
$ ./javaws -about
This will run the javaws
(Java Web Start) binary included with IcedTea-Web, and -about
has it pop up a small Java GUI app just to make sure everything works. If all goes well, you'll get the IcedTea-Web logo for a moment, followed by an about dialog that looks like this*:
Now, you could just run any random .jnlp
file this way (i.e., ~/icedtea/icedtea-web-image/bin/javaws somefile.jnlp
). That's valid... and a bit annoying to type out the full path every time. Per this answer, we'll install it into /opt
, and make a symlink in /usr/local/bin
for the binaries. Go to wherever you extracted the zip to (for me, ~/icedtea
). If you do ls
here, you should see a folder named icedtea-web-image
. Now, do sudo cp -r icedtea-web-image /opt
. Now, in the /opt
directory, there should be a folder called icedtea-web-image
. Time to make the symlinks. Here are the links we'll make
Source |
Destination |
/opt/icedtea-web-image/bin/javaws |
/usr/local/bin/javaws |
/opt/icedtea-web-image/bin/itweb-settings |
/usr/local/bin/itweb-settings |
/opt/icedtea-web-image/bin/policyeditor |
/usr/local/bin/policyeditor |
$ sudo ln --symbolic /opt/icedtea-web-image/bin/javaws /usr/local/bin/javaws
$ sudo ln --symbolic /opt/icedtea-web-image/bin/itweb-settings /usr/local/bin/itweb-settings
$ sudo ln --symbolic /opt/icedtea-web-image/bin/policyeditor /usr/local/bin/policyeditor
Now that we've made the links, from your home directory (~
), do javaws -about
. If all went well, the about dialog (shown above) will pop up. Now, download your .jnlp
file and save it somewhere (I'll assume it is ~/Downloads/somefile.jnlp
). To run that file, just do javaws ~/Downloads/somefile.jnlp
, and it should run! Sadly, this method doesn't support browser integration, but you can still run the .jnlp
file manually.
*You may observe that those window borders aren't Ubuntu, but instead Windows 10. However, due to me not having a real Ubuntu install at the moment (I mostly use Arch for Linux), I'm testing this in WSL2. I have an X server setup (VcXsrv) that lets me run GUI apps in WSL2, which is why it looks like Windows. But, this is still real Ubuntu 20.04, just with the X server on Windows.