can't launch link.exe or cl.exe from a java prog



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();
}
}
}
.



Relevant Pages

  • Re: Hash table performance
    ... Java HotSpotClient VM ... @param args the command line arguments ... public static void main{ ... The results of profiling are as follows: ...
    (comp.lang.java.programmer)
  • Re: ?meterware? WebConversation jar
    ... @param args the command line arguments ... public static void mainthrows MalformedURLException, ... I wanted to use libcurl for Java but couldn't ...
    (comp.lang.java.help)
  • Re: Question about sample Java application
    ... > private static String name; ... > public static void main{ ... In most of what I've been doing, when I have to do a Java ... application within that one .java file. ...
    (comp.lang.java.programmer)
  • Re: beginners question
    ... It must accept a String array as a parameter. ... public static void main ... When java tells you that it cannot find a method, ... requiring an applet viewer. ...
    (comp.lang.java)
  • JNI - unresolved _ZNSs4_Rep11_S_terminalE
    ... which (the main-driver) calls JAVA again to ... do the real work for processing the message. ... when starting the JAVA MainWrapper ... public static void main{ ...
    (comp.lang.java.programmer)

Quantcast