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

How to create a bat file to run a executable jar

 
Sindhu Kodoor
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am sorry if this topic is already raised somewhere else, I did search few places dint get this one, kindly help me write a bat file to run a simple executable jar file, I did start to write with the basic commands tutorial from the internet, I am not sure how to give the location of the jar file in the .bat :



The above code does not work, as it says
Unable to located test.jar


Kindly help me with this...
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect the spaces in the path are causing the bat file command line to be misinterpreted. Rename that "Proof OF" ...etc directory without spaces.

Generally speaking, paths with spaces cause nothing but trouble in Java.

Note that if you are executing this bat file from a Java program with exec() you will have to consume the std out and std err streams created by the Process - see java.lang.Process javadocs.

Bill
 
Sindhu Kodoor
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply, I had missed out one line
cd <<location path of the jar file>>
, now it works....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic