This is how I solved in Gnome -

 

1 - create file /usr/share/applications/java.desktop

 

In it, paste the below. It may not be perfect, I just wrote this as I went -

 

[Desktop Entry]

Name=OpenJDK

Comment=Java Application Launcher

Exec=/usr/bin/java -jar %f

Icon=java

Terminal=false

Type=Application

NoDisplay=true

Categories=Utility

MimeType=application/x-java-archive;

 

2 - In Files/Nautilus, right click a jar and click properties. On the ‘open with’ tab, click Reset at the bottom - I had to do this to get OpenJDK to then show up. Then select OpenJDK, and click Set as Default.