This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I want to set -Duser.timezone property in Windows NT with a particular timezone. In Eclipse I could set it using Runtime confguration. The same I could do using argument to Java command. However, I want to do the same by using Environment Vto set -Duser.timezone property for JVM. Is it possible to do so? If yes, then how can I do that?
Oh, okay. Then you pick a name -- let's call it JAVA_TIME_ZONE -- and create an environment variable whose value is "-Duser.timezone=whatever". Then at the command line, instead of doing
you do this instead:
Although I don't know why you would want to do that; it doesn't really help with any problem that I can see.
Joined: Sep 24, 2007
Thanks for the reply.
Is there any way to use this environment variable without passing it as an argument to java command?
That is, If I set this environment variable as you suggested and then just run java program using-
, how will this program pick up value of the said environment variable?
I want to acheive this: Whenever any Java program runs on my machine it should use the timezone specified through the environment variable.