小能豆

How to view the running JAR path in cmd or PowerShell?

javascript

  1. JAR path is “D:\AA\BB\Test.jar”
  2. Change CLI current path to “D:\AA\BB”
  3. Execute javaw -jar Test.jar
  4. Close CLI

In the task manager, there is only the “javaw.exe process”, and the command line does not have Test.jar path information.

enter image description here

enter image description here

How to view the path of a jar through cmd, power shell commands, or other methods


阅读 78

收藏
2023-11-21

共1个答案

小能豆

This is the information I currently have, when I use microsoft official tool Process Explorer,I got this information

enter image description here

The key information is Current directory. I think this is OS process concept(current working directory).

I want to do it in a simple way(like CLI)get running Jar full path,but when Jar starting in relative,I need get process CWD.

Perhaps I can simply obtain the process CWD on Linux through the CLI without coding,But I currently can’t find it on Windows.

By the way,This issue is not very important,I will close it.

2023-11-21