Process p = Runtime.getRuntime().exec("cmd.exe /c echo %JBOSS_HOME%"); BufferedReader br = new BufferedReader ( new InputStreamReader( p.getInputStream() ) );
bleh = br.readLine();
The problem I have is this, sometimes this code simply stops working and returns null. Is there a way to get this value all the time? Maybe using JNI or something. A fail safe method of reading an environmental variable. Thanks a lot.