What's the diffrence btw System property and system environment variable

Posted by khue on Stack Overflow See other posts from Stack Overflow or by khue
Published on 2010-05-19T07:45:46Z Indexed on 2010/05/19 7:50 UTC
Read the original article Hit count: 272

Filed under:
|
|
|

Hi all I am not clear about this. When I run a java App or run an Applet in applet viewer,( in the IDE environment), System.getProperty("java.class.path") give me the same as System.getenv("CLASSPATH"), which is the CLASSPATH env variable defined.

But when I deploy my applet to webserver and access it from the same computer as a client, I get different result for the two (System.getProperty("java.class.path") only point to jre home and System.getenv("CLASSPATH") return null).

And here is some other things that make me wonder: For the applet part, the env var JAVA_HOME, i get the same result when deploying the applet in a browser as well as Applet Viewer.

And if I define myself a env variable at system level, and use getenv("envName") the result is null. Is there anyway I can define one and get it in my java program?

Thanks a lot Regards K.

© Stack Overflow or respective owner

Related posts about java

Related posts about classpath