Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if the Java virtual machine process state management tool jps fails

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the Java virtual machine process state management tool jps failure how to do, the content is very detailed, interested friends can refer to, hope to be helpful to you.

JPS command, editor to give you a thorough mention of the use of this command, and some of the problems encountered.

Jps (Java Virtual Machine Process Status Tool) is a command provided by JDK 1.5 that displays the pid of all current java processes. Many people will use it, but many people may encounter some strange problems in the process of using it.

The jps command is stored in the JAVA_HOME/bin/ directory, and if your directory is not added to the Path, using this command may prompt you that the command does not exist and cannot be recognized.

The format of the jps command is:

There are 5 commonly used option parameters:

-Q displays only pid, not class name, jar file name, and parameters passed to the main method

-m outputs the parameters passed to the main method, which may be null on the embedded jvm

-l output the full package name of the application main class or the full pathname of the jar file of the application

-v outputs the parameters passed to JVM

-V hides the parameters passed to the JVM from the output

We often type jps directly. If you forget how to use it, you can use the jps-help command to check the help information:

After saving resources, our company has shared resources and deployed more than a dozen applications on some machines. Resulting in some people can not access the program, this is a very simple question, jps to see whether the application is up. If there is no application, take a look at the log and eventually find that the port is occupied. Check the port command, and we'll talk about it later.

After showing you the jps command, everyone knows how to operate it. But some people find that the jps command is not available at all on some machines. The reasons are as follows:

The first case is that the JAVA_HOME/bin/ directory is not added to the path environment.

The second is the problem of read and write permissions for disk directories. The data source of jps, jconsole, jvisualvm, and other tools is this file (/ tmp/hsperfdata_userName/pid), and userName is the user name, so when the file does not exist or cannot be read, jps will not be able to view the process number. In this case, you can see the started java process using the ps-ef | grep java command.

The third situation is that the / tmp directory is deleted or cleaned regularly, or the disk is full.

The last possibility is that your program sets the-Djava.io.tmpdir parameter when it starts. Causes the storage address of the java process information file to be changed to another location.

If you have no problem with all four of the above, find out the reason for your project.

On the Java virtual machine process state management tool jps failure how to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report