Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Read System Environment Variable from Java Code - Access Denied

843798Feb 24 2005 — edited May 21 2005
When 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!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 18 2005
Added on Feb 24 2005
2 comments
230 views