How to set default parameters to jvm?

iceberg picture iceberg · Feb 1, 2013 · Viewed 20.4k times · Source

I'd like to know how I can pass parameters to JVM before it is started. For example,

I think I need to modify JVM timezone parameter.

I use eclipse with windows 7.

Answer

Evgeniy Dorofeev picture Evgeniy Dorofeev · Feb 1, 2013

In Eclipse go to

Run As -> Run Configurations -> Arguments -> VM Arguments

and set required JMV argument, eg

-Duser.timezone=PST

you can get all timezone IDs available in JVM by running this test

for(String id : TimeZone.getAvailableIDs()) {
    System.out.println(id);
}

output

Etc/GMT+12
Etc/GMT+11
Pacific/Midway
Pacific/Niue
Pacific/Pago_Pago
Pacific/Samoa
....