Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

The PTC Community email address has changed to Learn more.

Running commands from JAVA and ACL?


Running commands from JAVA and ACL?

I'm having troubles with running a command (basically an Ant script) from
Java within Arbortext. Here is the code:

public static void build() {

String s = null;

try {

String[] commands = new String[]{ "C:\\Program
Files\\nsiv3.1.15.2\\bin\\makedoc.bat", "IETP"};

Process p = Runtime.getRuntime().exec(commands);

BufferedReader stdInput = new BufferedReader(new
BufferedReader stdError = new BufferedReader(new

// read the output from the command

System.out.println("Here is the standard output of the
while ((s = stdInput.readLine()) != null) {

// read any errors from the attempted command

System.out.println("Here is the standard error of the command
(if any):\n");
//while ((s = stdError.readLine()) != null) {
// System.out.println(s);
catch (IOException e) {
System.out.println("exception happened - here's what I know: ");


And I run this with either java_static() or java_static_modal() with about
the same results. the basic makedoc deploy command runs a multistep build
process. Thsi scripts runs to about 99% complete and then just hangs. At
the point it seems to stop (or at least the output I get in the console
window) is that it is zipping the files together that were built. The last
step is to then "deploy" the files to another location on my local

I'd sware that this code worked a couple of times last week when I asked
about setting the working directory consistently. I'm now working in the
right location, but now things just stop.

When I look at an run the files that were built it looks like everything
completed. Am I getting some weird interaction between the two operations?

Here is my calling sequence from the ACL

java_static('NSIVbuild', 'genBuildProps');
java_static('NSIVbuild', 'genPubModule', $selection)

java_static('NSIVbuild', 'remove');

response("Starting build, this takes a minute or two")
# Build works if the directory is set properly, but the cd commands
# are having problems above
java_static('NSIVbuild', 'build');

response("Completed, now launching NSIV")
java_static('NSIVbuild', 'display');

I get into the java_static('NSIVbuild', 'build'); but I never get the
response window after that.