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" ) );
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:
Post a Comment