I have a batch file called run.bat that includes the following code:
@echo off
REM bat windows script
set CXF_HOME=.\lib\apache-cxf-2.2.7
java -Djava.util.logging.config.file=%CXF_HOME%\logging.properties -jar archiveServer-0.1.jar
When I run this file on the command line, it works fine. However, when I try to execute in a java file with the following statement:
File path = new File("C:/Documents and Settings/Zatko/My Documents/Project-workspace/IUG/external/application/archive");
Runtime.getRuntime().exec(new String[]{"cmd.exe", "/C", "start", "run.bat"}, new String[]{}, path);
The following error appears in the terminal window:
'java' is not recognized as internal or external command, operable program or batch file.
Where could the error be?
Anto source
share