Java为我们提供了大量的工具辅助我们进行开发,位于jdk目录下的bin目录里,本篇博客将会随时更新相关工具的使用说明。
jps 获取当前运行的java应用
lgj@lgj-Lenovo-G470:~/java/FastDFS$ jps -help usage: jps [-help] jps [-q] [-mlvV] [<hostid>] Definitions: <hostid>: <hostname>[:<port>]
jps -q 获取运行的pid
lgj@lgj-Lenovo-G470:~/java/FastDFS$ jps -q
16260
24679
23063
2952
6888
3372
jps -mlvv 输出pid / 运行类 / 虚拟机配置信息
lgj@lgj-Lenovo-G470:~/java/FastDFS$ jps -mlvv
16260 com.dubbo.frame.rabbitmq.receiver.RabbitMqReceiverApplication -Dvisualvm.id=3467430180439 -XX:TieredStopAtLevel=1 -Xverify:none -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=38609 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -javaagent:/home/lgj/java/idea-IU-183.4886.37/lib/idea_rt.jar=46313:/home/lgj/java/idea-IU-183.4886.37/bin -Dfile.encoding=UTF-8 23063 com.dubbo.frame.rabbitmq.sender.RabbitMqSenderApplication -Dvisualvm.id=69303222220606 -XX:TieredStopAtLevel=1 -Xverify:none -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=36153 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -javaagent:/home/lgj/java/idea-IU-183.4886.37/lib/idea_rt.jar=43247:/home/lgj/java/idea-IU-183.4886.37/bin -Dfile.encoding=UTF-8 2952 com.intellij.idea.Main -Xms128m -Xmx750m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -ea -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -Djdk.http.auth.tunneling.disabledSchemes="" -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Dawt.useSystemAAFontSettings=lcd -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine -javaagent:/home/lgj/java/idea-IU-183.4886.37/bin/JetbrainsCrack-2.10-release-enc.jar -XX:ErrorFile=/home/lgj/java_error_in_IDEA_%p.log -XX:HeapDumpPath=/home/lgj/java_error_in_IDEA.hprof -Didea.paths.selector=IntelliJIdea2018.3 -Djb.vmOptionsFile=/home/lgj/java/idea-IU-183.4886.37/bin/idea64.vmoptions -Didea.jre.check=true 6888 ./ApacheJMeter.jar 24923 sun.tools.jps.Jps -mlvv -Denv.class.path=.:/home/lgj/java/jdk1.8.0_191/lib:/home/lgj/java/jdk1.8.0_191/jre/lib -Dapplication.home=/home/lgj/java/jdk1.8.0_191 -Xms8m 3372 org.jetbrains.idea.maven.server.RemoteMavenServer -Djava.awt.headless=true -Didea.version==2018.3.2 -Xmx768m -Didea.maven.embedder.version=3.3.9 -Dfile.encoding=UTF-8
jps 输出pid /运行类
25120 Jps 16260 RabbitMqReceiverApplication 23063 RabbitMqSenderApplication 2952 Main 6888 ApacheJMeter.jar 3372 RemoteMavenServer