I found only when I put -Dcontext=web
into VM arguments, the value can be read by System.getproperty
method. I am wondering what\'s the difference betw
Program arguments are arguments passed to your program and available in the args
array of your main method
public static void main(String[] args)
VM arguments are passed to the virtual machine and are designed to instruct the VM to do something. You can do things like control the heap size, etc. They can be accessed by your program via a call to System.getProperty()
as you described.