I recently had problems too running Java applets with Iced Tea. I installed Oracle Java to solve the problem following the info on this webpage.
I installed version 8:
open Terminal: Ctrl+Alt+T
run the following commands:
sudo add-apt-repository ppa:webupd8team/java
update package lists:
sudo apt-get update
Install Oracle Java 8:
sudo apt-get install oracle-java8-installer
While installation, you’ll be asked to agree the license and then the installer start downloading Java file from oracle website and install it on your system.
To set the default Java:
sudo apt-get install oracle-java8-set-default
Finally check whether everyting is OK:
Icedtea Java Plugin is a web browser plugin to execute Java applets. You can install Icedtea Java Plugin from the default Ubuntu 14.04 repositories (icedtea-7-plugin) and the default Ubuntu 16.04 and later repositories (icedtea-8-plugin), and this will also install whatever Java dependency packages you need to install Icedtea Java Plugin.
Select Settings menu (3 horizontal lines icon ≡ in the upper right corner ) -> Web Developer -> Scratchpad.
#!/usr/bin/js var animal = "dog"; var count = 2; console.log("The", animal, "ate", count, "biscuits.");
The dog ate 2 biscuits.