Hi
I have a below problem
I have installed latest java 1.7 application from sun and i want to execute the java application through bat file
Below is my bat file
@echo off
Title Java Account Manager 1.0 Startup
cd .\Initial
C:\Program Files\Java\jre7\bin\java.exe -jar CertifyAMInitial.jar"
When i execute it i am getting the below error
When I try to execute executeInitial.bat through command line it gives me the below error
"C:\Program' is not recognized as an internal or external command,operable program or batch file"
Can you please help me
Thanks,
Kumar
Executing Jar files through bat file
Moderator: DosItHelp
Re: Executing Jar files through bat file
The path to your java.exe includes a space, so you need quotes around the complete file path. You don't have quotes, so the command tokenizer treats c:\Program as the command.
It is generally a good idea to put quotes around file names to avoid this kind of problem.
I believe this line will work:
Dave Benham
It is generally a good idea to put quotes around file names to avoid this kind of problem.
I believe this line will work:
Code: Select all
"C:\Program Files\Java\jre7\bin\java.exe" -jar "CertifyAMInitial.jar"
Dave Benham
-
- Posts: 32
- Joined: 08 Jul 2011 03:38
Re: Executing Jar files through bat file
Hi Dave,
Yes you are correct. Once i Include in the quotes it works perfectly.
Thanks a lot for your help.
Just want to say one thing about this forum.
A TOUGH PROBLEM CAN BE SOLVED EAISLY BY THE EXPERTS HERE.
I LOVE THIS FORUM AND HOPE THE SAME IN FEATURE
Yes you are correct. Once i Include in the quotes it works perfectly.
Thanks a lot for your help.
Just want to say one thing about this forum.
A TOUGH PROBLEM CAN BE SOLVED EAISLY BY THE EXPERTS HERE.
I LOVE THIS FORUM AND HOPE THE SAME IN FEATURE