I\'m playing around with some microservices and running them on my laptop, simply assigning each micro-service a new port. The problem is that I\'d like to restart one of th
Under Windows, you can't (unless installing some kind of posix subsystem).
Under Linux, you could use exec
command with the -a "newName"
option to alias the process you wish to spawn.
Like
exec -a "myJar" /path/to/java -jar /path/to/jar.jar
If you need to be able to differentiate between different java programs you can use the jps command that gives you a list of all java processes and running your program with
java -Dname=myFirstService -cp myFirstService.jar some.client.main.MyFirstService
then if you do a:
jps -v
You will see your process correctly.
If you need to change the process name at the OS level I recommend you use http://launch4j.sourceforge.net/