Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Run a jar file inside a batch file with Windows 7 Task schduler

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Run a jar file inside a batch file with Windows 7 Task schduler

    Hi,
    I have a batch file, which include the following command;
    java -jar ExportPDFTool.jar Xml=D:\\Data\\XML\\VNM\\%FolderName% Xsl=D:\\Data\\BatchPrinting\\xsl Pdf=D:\\Data\\PDF\\VNM_Local_PDF\\%FolderName% Log=D:\\Data\\Log\\VNM\\%FolderName%_convert.log
    When I setup the Windows 7 Task Schduler for the batch file, all the commands in the batch file run well but the system seem to ignore the java -jar command (I can not see the convert.log file).
    Please kindly give me a help to find out problem.
    Thanks.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Run a jar file inside a batch file with Windows 7 Task schduler

    Have you tested the batchfile in a command prompt window? Did it work there?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Jan 2011
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Run a jar file inside a batch file with Windows 7 Task schduler

    Quote Originally Posted by kingnachi View Post
    Hi,
    I have a batch file, which include the following command;
    java -jar ExportPDFTool.jar Xml=D:\\Data\\XML\\VNM\\%FolderName% Xsl=D:\\Data\\BatchPrinting\\xsl Pdf=D:\\Data\\PDF\\VNM_Local_PDF\\%FolderName% Log=D:\\Data\\Log\\VNM\\%FolderName%_convert.log
    When I setup the Windows 7 Task Schduler for the batch file, all the commands in the batch file run well but the system seem to ignore the java -jar command (I can not see the convert.log file).
    Please kindly give me a help to find out problem.
    Thanks.

    1. first run your command from command prompt, if success than create batch file
    2. check Java is in path
    3. Check ExportPDFTool.jar has main class or not

    If you are running Java program from Jar first time then you can also check How to create and execute JAR file in Java – Command line Eclipse Netbeans

    Also let us know exact error you are getting, that would be helpful

Similar Threads

  1. Generating a Batch File - Static Method Error
    By Stroypet in forum What's Wrong With My Code?
    Replies: 3
    Last Post: May 17th, 2012, 11:42 AM
  2. Not able to put some files inside Zip file
    By chinnu in forum File I/O & Other I/O Streams
    Replies: 0
    Last Post: March 23rd, 2011, 05:17 AM
  3. My Jar File Crashing Windows 7
    By PrinceSendai in forum What's Wrong With My Code?
    Replies: 0
    Last Post: January 19th, 2011, 02:49 PM
  4. how to read file name inside .gz file....
    By kathir0301 in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: December 6th, 2010, 10:06 AM
  5. calling a java a class connected to derby from a batch file
    By Reem in forum What's Wrong With My Code?
    Replies: 4
    Last Post: October 31st, 2010, 03:01 PM