wood burning stoves 2.0*
The moose likes Java in General and the fly likes How to create a bat file to run a executable jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to create a bat file to run a executable jar" Watch "How to create a bat file to run a executable jar" New topic
Author

How to create a bat file to run a executable jar

Sindhu Kodoor
Ranch Hand

Joined: Sep 03, 2010
Posts: 65
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

Joined: Mar 22, 2000
Posts: 12755
    
    5
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

Joined: Sep 03, 2010
Posts: 65
Thanks for your reply, I had missed out one line
cd <<location path of the jar file>>
, now it works....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to create a bat file to run a executable jar
 
Similar Threads
Unexpected java version in class file
SimpleTagSupport compile error
wsStartServer ANT task
An unexpected error has been detected by HotSpot Virtual Machine
Unable to parse setupCmdLine: null\bin\setupCmdLine.bat