I am trying to run a executable jar file I made in Intellij on JDK 11.0.2 that contains a GUI system. I have java 8 and Java SDK 11.0.2 installed. Whenever I double click the jar file I expect the main gui login screen to come up, but nothing happens. I have tried other options such as trying to run it through cmd (it gave me an access error) and the HKEY_CLASSES_ROOT\jarfile has the command: "C:\Program Files\Java\jdk-11.0.2\bin\javaw.exe" -jar "%1" %* already.
Asked
Active
Viewed 83 times
3
-
having same issue :( – Syed Mehtab Hassan Apr 17 '19 at 06:51
-
Have you seen https://stackoverflow.com/questions/394616/running-jar-file-on-windows – J_D Apr 17 '19 at 06:53
-
@J_D i have seen that it gives me error **could not find or open main class** – Syed Mehtab Hassan Apr 17 '19 at 06:54
-
Have a look at this [post](https://stackoverflow.com/questions/18093928/what-does-could-not-find-or-load-main-class-mean) – J_D Apr 17 '19 at 06:55
-
@J_D i go through almost every post here on stack but unable to solve my problem. – Syed Mehtab Hassan Apr 17 '19 at 07:18
-
Do you have a main class in the jar? Have you opened it to check? If yes, then proceed to check your permissions ... '(it gave me an access error)' Do you have the relevant permissions to execute the jar? – J_D Apr 17 '19 at 07:20
-
Did it worked through command line or not? – Jean-Baptiste Yunès Apr 17 '19 at 08:22
1 Answers
0
Cant comment quite yet on other peoples posts so ill just submit an answer, tho its gonna be more of a swing and miss probably.
Id recommend opening that jar file with a java decompiler (The one i had in mind is jd-gui) and checking the integrity of the code, file system, and, in general, just check arround for common errors when packaging, maybe you included something you shouldnt in the class and hence why the problem, or its crashing on load cause of a missing reference you had linked to with a relative path which got broken upon moving the file, those are the two big ones that come to mind that you should check first upon opening the file, other than that, i cant provide much more insight, godspeed to you!

Skye
- 21
- 6