I'm trying to automate a process, one of which requires doing an ant build. I've set up all the environment variables. Inputting commands directly into cmd works:
my build.xml has some properties like these:
<property name="java.home" value="${env.JAVA_HOME}"/>
<property name="java.compiler.path" value="${JAVA_HOME}\bin\javac"/>
<echo> ${java.home} </echo>
<echo> ${java.compiler.path} </echo>
and calling "ant" on the cmd will echo the directory of the JDK. However, calling ant through ProcessBuilder
CommandUtils.execute("\"c:\\Program Files (x86)\\Ant\\bin\\ant\"");
//inside execute() { pb = new ProcessBuilder("cmd", "/c", command);....}
will echo ${java.home} and ${java.compiler.path} literally. Is there any change I can make to point to the java path so that ProcessBuilder will recognize the java path?