This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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: 20902
76
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