If you start multiple Java programs, and because all Java programs run in the JVM, the process Manager will have multiple java.exe, but how do you determine if a Java program corresponds to Java.exe in the process?
You can use the Java VISUALVM tool to implement the "JVISUALVM" command on the Windows CMD Console or Linux terminal to enter the Java VISUALVM Workbench.
Mouse double-click on the left side of the tree process list of a process (PID is the process id), in the lower right of the pop-up window, click on the "System Properties" tab, drag down the scroll bar to the bottom, view the "User.dir" parameter, you can see the location of the program, the Java program specific process ID.
Other
For Linux, you can use the JPS command to filter based on known special configurations or characters in the service, such as a service with the XMS parameter configured as "7168m", using the following command to get the process ID for this service:
JPS -v|grep 7168
View Java Process ID method under Windows/linux environment