Search This Blog

Wednesday, January 22, 2020

Java CMD -D arguments Custom

Note your java class or jar name should be at last and not first before -D.

Ex:
YES = java -jar -Dfiles=c1 -Dexcludes=va2 filename.jar
NO = java -jar filename.jar -Dfiles=c1 -Dexcludes=va2


In Program
Properties systemProperties = System.getProperties();
System.out.println( systemProperties.get ( "files" ) );
System.out.println( systemProperties.get ( "excludes" ) );


No comments:

Hit Counter


View My Stats