我有一个shell脚本正在运行
#!/bin/sh
echo -n "Starting JProfiler... "
nohup java -agentpath:/opt/jprofiler13.0.2/bin/linux- x64/libjprofilerti.so=port=8864,nowait
运行脚本后,我看到以下内容,但Jprofiler从未启动,即使它说VM已初始化。
JProfiler> 64-bit library
JProfiler> Starting up without initial configuration.
JProfiler> Listening on port: 8865.
JProfiler> Enabling native methods instrumentation.
JProfiler> Can retransform classes.
JProfiler> Can retransform any class.
JProfiler> Native library initialized
JProfiler> VM initialized
JProfiler> Retransforming 110 base class files.
JProfiler> Base classes instrumented.
Usage: java [options] <mainclass> [args...]
(to execute a class)
or java [options] -jar <jarfile> [args...]
(to execute a jar file)
or java [options] -m <module>[/<mainclass>] [args...]
java [options] --module <module>[/<mainclass>] [args...]
(to execute the main class in a module)
or java [options] <sourcefile> [args]
(to execute a single source-file program)
Arguments following the main class, source file, -jar <jarfile>,
-m or --module <module>/<mainclass> are passed as the arguments to
main class.
where options include:
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
--class-path <class search path of directories and zip/jar files>
A : separated list of directories, JAR archives,
and ZIP archives to search for class files.
-p <module path>
--module-path <module path>...
A : separated list of directories, each directory
is a directory of modules.
--upgrade-module-path <module path>...
A : separated list of directories, each directory
is a directory of modules that replace upgradeable
modules in the runtime image
--add-modules <module name>[,<module name>...]
root modules to resolve in addition to the initial module.
<module name> can also be ALL-DEFAULT, ALL-SYSTEM,
ALL-MODULE-PATH.
--list-modules
list observable modules and exit
-d <module name>
--describe-module <module name>
describe a module and exit
--dry-run create VM and load main class but do not executee main method.
The --dry-run option may be useful for validating the
command-line options such as the module system configuration.
--validate-modules
validate all modules and exit
The --validate-modules option may be useful for finding
conflicts and other errors with modules on the module path.
-D<name>=<value>
1条答案
按热度按时间c9qzyr3d1#
这不是启动JProfiler的方法。在Linux/Unix上,JProfiler UI是通过执行shell脚本
bin/jprofiler
来启动的。您的shell脚本所做的与执行
java
相同-它会给您提供用法帮助文本。使用
-agentpath
VM参数,可以将JProfiler代理加载到JVM中,这是手动启动JVM进行性能分析的方式,但还必须指定类路径和主类。