How to give the java process a name in the operating system (other than java)

前端 未结 2 1439
庸人自扰
庸人自扰 2021-01-04 07:25

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

2条回答
  •  北海茫月
    2021-01-04 07:54

    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
    

提交回复
热议问题