Strange: I got your error message if I type in java JabRef-4.0.jar.
But it works if I use java -jar JabRef-4.0.jar.
Could you check your command-line please?
JabRef requires Java 8. Please follow the steps provided on our installation page. JabRef does not yet run under Java 9. See Java 9/JDK9 compatibility - blocks: Java 11/JDK11 compatibility · Issue #2594 · JabRef/jabref · GitHub
You might see the error message Error: Could not find or load main class net.sf.jabref.JabRefMain. This means, you do not have JavaFX support activated in your Java runtime environment. This typically happens if you use OpenJDK, where one needs to setup OpenJFX seperately.
Our installation page recommends JDK from oracle - but one heading above, the installation for Ubuntu 16.04 is given - which is somehow similar to that was Tony says:
Just install JavaFX by executing sudo apt-get install openjfx