Read System Environment Variable from Java Code - Access Denied
843798Feb 24 2005 — edited May 21 2005When i execute the java code to get a value from system environment variable, the server give the following error:
access denied (java.io.FilePermission <<ALL FILES>> execute)
I was using Sun One Java Server v8, Windows XP Pro, and JDK 1.4
The code that i use as follow:
public static Vector execCommand(String command)
{
...
String command= "cmd /c echo %JAVA_HOME%";
Process child = Runtime.getRuntime().exec(command);
...
}
The same code when execute using JBOSS 3.x application server was totally fine. Please help!