I am really new to java (started learning 2 days ago). Sorry if this is a stupid question. I am trying to learn how to use rt.exec & similar methods so I tried to make a very simple program which runs calc.exe. This is the code:
public class main {
{
try {
Runtime rt = Runtime.getRuntime() ;
Process p = rt.exec("calc.exe") ;
}
catch(Exception exc){/*handle exception*/}
}
}

I get the error " The value of local variable p is not used".
And if I try to compile this is what I get:
I think it's easy to fix but I don't know how. Would be nice if someone helped.
public static void main(String[] argv)(exactly like that).Launch Erroris a run-time error rather than a compile time error. 3) Someone who is "really new to java" should try easier things than using platform specific code to create aProcess. There is this 6 page article that describes some of the requirements for using aProcesscorrectly. It will, for example, require aThreadto consume the output streams of theProcess.