Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Opening .jar from .bat shortcut...

 
Primoz Karnekaj
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
I made a program in NetBeans and everything is working OK.
I created a .bat file, which opens the .jar program correctly, but also opens a "cmd window" next to .jar program.

This is in the .bat file:
"folder\program.jar"

This does the same thing:
java -jar "folder\program.jar"

Now I am wondering how one could open this .jar program itself without cmd window next to it, using a .bat file or some other shortcut? Are there any flags like -nocmd..

Thanks
 
Henry Wong
author
Marshal
Pie
Posts: 21114
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the "javaw" command should work here...

Henry
 
Primoz Karnekaj
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javaw is not wroking, unless i'm doing something wrong..

Here is the screenshot to make thing clearer

 
Steve Luke
Bartender
Posts: 4181
21
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The terminal you see is the one that the Batch file is executing in. In order to get rid of it you need to tell Windows to start the application in a 'new' window/terminal. You do this with the START command:
 
Primoz Karnekaj
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for helping me out, it works perfectly!

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic