I've been struggling with this problem for a while now. I found this and this but those solutions won't work for me at all.
My jar works perfect with java -jar on command prompt but when it comes to double click, a JFrame window is opened but it fails on these:
Scanner fileLat = new Scanner( a.getClass().getResourceAsStream("/motor/resources/lat.txt") );
Scanner fileLong = new Scanner( a.getClass().getResourceAsStream("/motor/resources/long.txt") );
Which result on null pointer exceptions and resources not being found.
My directory structure (inside the jar) looks like this:
/ (root)
|- META-INF
|- motor
|- main
|- Main.class
|- resources
|- lat.txt
|- long.txt
And my MANIFEST.MF reads as follows:
Manifest-Version: 1.0
Class-Path: .
Main-Class: motor.main.Main
Edit: I just attempted this (especifically, the jar:file:MyJar.jar!/etc...) and it didn't work either.