Is it possible to override system property (timezone etc.) in Java using predefined properties file for all Java applications?
I couldn't find such a file in my Windows 7 64bit OS.
Java version is 1.7.0_03 (JDK 64 bit)
Java "-Duser.timezone parameter cannot be used because it is a compiled exe file (does not accept java parameter). And we use those java applications as end users. We have not developed them. So setting timezone by programming is not an option.
Java uses different timezone other than systems'. I think there are some bugs with Java with Windows 7.
http://oraclesoon.blogspot.com/2010/04/windows-7-and-java-jdk-16-timezone.html
You cannot "override" fields, because only methods can have overrides (and they are not allowed to be static or private for that).
System. clearProperty(String key) method enables you to remove a system property. The key must not be an empty string or a null value because it will cause the method to throw an IllegalArgumentException or a NullPointerException .
The _JAVA_OPTIONS envionment variable allows you to set commandline flags when java is run.
The following propagated into java for me (on OSX):export _JAVA_OPTIONS='-Duser.timezone=Europe/Copenhagen'
It is hard to know if it will work with your .exe setup also but give it a try.
You may need to restart after changing environment variables on windows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With