Home > Article > Operation and Maintenance > How to query java path in linux
How to query the java path in Linux: 1. Check the relative path through the ps and top commands; 2. Check the absolute path of the directory where java is running, that is, "pos_service.jar" by executing the "ll /proc/PID" command. .
#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
How to query the java path in Linux?
linux Check the directory where java is running
When checking the process information through the ps and top commands, only the relative path can be found, and the detailed information of the process cannot be found
You need to check the absolute path of pos_service.jar (in which directory it is located). Use: ll /proc/PID
Linux is starting When there is a process, the system will create a folder named after PID under /proc. Under this folder, there will be information about our process, including a file named exe, which records the absolute path, through ll or ls You can view it with the -l command.
ll /proc/PID
cwd symbolic link is the process running directory;
exe symbolic link is the absolute path to execute the program;
cmdline is the command line command entered when the program is running;
environ records the environment variables when the process is running; the
fd directory is the symbolic link of the file opened or used by the process.
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of How to query java path in linux. For more information, please follow other related articles on the PHP Chinese website!