Windows Vista Beta | WinVistaBeta.com - Message | can't launch link.exe or cl.exe from a java prog

August 29, 2008  
Subject: can't launch link.exe or cl.exe from a java prog
Group: microsoft.public.vstudio.general
Date: 6/4/2008 4:30:08 AM
From: elekis [Email Address Protection]

hi all.

I have a big trouble with the link.exe and cl.exe.

I try to lauch there from a java application (see below) and I don't
know why , that doesn't work.
the funny thing is that this code work with ohter program like echo,
make, etc... so it's not a java problem.

I ve try the complete path (absolute) , the relative, etc... with this
all program I have the same error , exit value is negatif (so it's a
prob) but the prog is found (cause if the path is false, there is a
exception).

and the funny is that if I try in cmd, that work (he print the help)
but if I try "cmd /C link" I have the same trouble.
So why only this two particular applications and not the rest?? and is
there any options to put or something like that to arrange that?

thanks

a+++


-------------------------------------------------------
import java.io.IOException;

public class Main {

/**
* @param args
*/
public static void main(String[] args) {

ProcessBuilder pb = new ProcessBuilder("link");
try {
Process p = pb.start();
try {
p.waitFor();
System.out.println("Process exitValue: " + p.exitValue());
} catch (InterruptedException e) {
e.printStackTrace();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}

Back