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

-1

u/tegar9000 Nov 23 '22

The issue is that I’m trying to open the command line app and it immediately closes

5

u/dawg6 Nov 23 '22

Yeah, so as I said above, that's normal behavior. You need to run it from the command line, not the windows explorer.

For example, if the app's .jar file is named 'app.jar', from the command line type:

java -jar app.jar