In Java we use System.setProperty() method to set some system properties. According to this article the use of system properties is bit tricky.
System
System properties are per-process. This means that they are more global than static fields, which are per-classloader. So for instance, if you have a single instance of Tomcat running multiple Java webapps, each of which has a class com.example.Example with a static field named globalField, then the webapps will share system properties, but com.example.Example.globalField can be set to a different value in each webapp.