I have a jar file (self-executable, with Main-class attribute set) and to run it I just need to double click it as jar files are associated with javaw on my machine. However, I needed to pass some arguments to this jar. So I put this one line into a cmd file and tried to run:
javaw -jar myJar.jar -Duser.home=C:\myTest\myHome
When I run this even though my GUI (jar is a swing app) comes up, command window doesn't go away. One has to put "start" also before for the command window to go away. So the above line should read as below:
start javaw -jar myJar.jar -Duser.home=C:\myTest\myHome
By the way, we can have all the profile files to be created at mentioned folder instead of default user.home by overriding the system variable as above.

javaw -jar myJar.jar -Duser.home=C:\myTest\myHome
When I run this even though my GUI (jar is a swing app) comes up, command window doesn't go away. One has to put "start" also before for the command window to go away. So the above line should read as below:
start javaw -jar myJar.jar -Duser.home=C:\myTest\myHome
By the way, we can have all the profile files to be created at mentioned folder instead of default user.home by overriding the system variable as above.