java - How to pass system properties to a jar file -
i have main class expects properties pass using -d option. can access in ide sending them vm options.
i package application jar file using maven , when try following:
java -jar myjar.jar -denviroment=dev
or
java -jar myjar.jar "-denvironment=dev"
the enviroment system property not getting picked up.
any pointers on going on?
pass arguments before -jar
. if pass them after jar file interpreted command line parameters , passed string[] args
in main
. like,
java -denviroment=dev -jar myjar.jar