DasAtanu
07-01-2008, 10:56 AM
I am unable to run a C exe from java.It is possible to run a notepad.exe from java but, when I am trying to run a C exe, it is giving an environment 16 bit MS DOS error.
the code:
try{
Runtime rt = Runtime.getRuntime();
String[]callAndArgs= {"notepad.exe"}; // {C:\\TCC\\ADG.EXE} for C exe
rt.exec(callAndArgs);
System.out.println("I am in try block");
}
catch(Exception e)
or
try {
String[] cmd = {"C:\\TCC\\ADG.EXE"};
Process p=Runtime.getRuntime().exec(cmd); //tell the path.
p.waitFor();
System.out.println("i am in try block");
}
catch(Exception e)
{
e.printStackTrace();
}
the error:
C:\windows\system32\ntvdm.exe
Error while setting up environment for the application.
Please reply asap.
the code:
try{
Runtime rt = Runtime.getRuntime();
String[]callAndArgs= {"notepad.exe"}; // {C:\\TCC\\ADG.EXE} for C exe
rt.exec(callAndArgs);
System.out.println("I am in try block");
}
catch(Exception e)
or
try {
String[] cmd = {"C:\\TCC\\ADG.EXE"};
Process p=Runtime.getRuntime().exec(cmd); //tell the path.
p.waitFor();
System.out.println("i am in try block");
}
catch(Exception e)
{
e.printStackTrace();
}
the error:
C:\windows\system32\ntvdm.exe
Error while setting up environment for the application.
Please reply asap.