在linux中查找正在运行的jar的绝对路径
我有一个在 Linux 虚拟机中运行 jar 的 java 进程。我运行“ps -ef | grep java”命令,得到以下信息——
odosvc 14700 23904 5 03:45 ? 00:00:21 java -Djava.security.egd=file:///dev/urandom -Xms512M -Xmx1024M -XX:+UseG1GC -XX:+PrintFlagsFinal -XX:ErrorFile=/logs/osd-service-api/HS_ERR_PID%p.log -XX:+PrintGCApplicationStoppedTime -XX:-ResizePLAB -Djavax.net.ssl.trustStore=/etc/pki/java/cacerts -jar target/osd-service-api-0.1.31.jar server target/config/oc1.conf
我想找到 osd-service-api-0.1.31.jar 的完整路径。我运行了以下
pwdx 14700 并得到了以下内容 ==
pwdx 14700
14700: /etc/runit/artifacts/osd-service-api
这仍然打印相对路径。在VM中,有许多上述形式的文件夹路径,其中包含同名的jar,因此我无法找到实际运行的jar的绝对路径。有什么方法可以获取正在运行的 jar 的绝对路径吗?
I have a java process running a jar in a linux vm. I ran "ps -ef | grep java" command and I get the following--
odosvc 14700 23904 5 03:45 ? 00:00:21 java -Djava.security.egd=file:///dev/urandom -Xms512M -Xmx1024M -XX:+UseG1GC -XX:+PrintFlagsFinal -XX:ErrorFile=/logs/osd-service-api/HS_ERR_PID%p.log -XX:+PrintGCApplicationStoppedTime -XX:-ResizePLAB -Djavax.net.ssl.trustStore=/etc/pki/java/cacerts -jar target/osd-service-api-0.1.31.jar server target/config/oc1.conf
I wanted to find the full path of the osd-service-api-0.1.31.jar. I ran the following
pwdx 14700 and I got the following==
pwdx 14700
14700: /etc/runit/artifacts/osd-service-api
This is still printing the relative path. In the VM there are many folder paths of the above form which contains jar of the same name and hence I am not able to find the absolute path of the jar which is actually running. Is there some way I can get the absolute path of the running jar?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论