I ran into this issue when running Jupyter Notebook and Spark using Java 11. I installed and configured for Java 8 using the following steps.
Install Java 8:
$ sudo apt install openjdk-8-jdk
Since I had already installed Java 11, I then set my default Java to version 8 using:
$ sudo update-alternatives --config java
Select Java 8 and then confirm your changes:
$ java -version
Output should be similar to:
openjdk version "1.8.0_191"OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12)OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
I'm now able to run Spark successfully in Jupyter Notebook. The steps above were based on the following guide: https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-on-ubuntu-18-04