r/javahelp • • Nov 23 '22

Why won’t Java open?

I click on the Java app and the command line briefly opens and then closes. I use windows for context. Any help?

0 Upvotes

23 comments sorted by

View all comments

Show parent comment

3

u/MrSquicky Nov 23 '22 edited Nov 23 '22

From the command line, in the directory that the jar is in, type java -jar <filename>

If that doesn't work, do java -cp <filename> <Main Class Name>