我正在尝试在Windows 7 64位上使用jvisualvm剖析一个简单的Java应用程序。我正在将Java 8与JDK 1.8.0_131一起使用。我可以看到我的应用程序并使用VisualVM的Sample选项卡,但是当我使用Profile选项卡的CPU选项时,出现“错误失败,定义错误62”。在线记录了此错误,常见的解决方案是在启动应用程序时包括标志-Xverify:none。但是,使用此标志对我无效。我已经使用JVisualVM本身和我的简单程序jar进行了尝试,都没有什么不同。以下是我正在使用的终端命令。
通过简单的程序使用Xverify。
java -jar SimpleProfile.jar -Xverify:none
将Xverify与jvisualvm一起使用
./jvisualvm.exe -J-Xverify:none
两者都从Git Bash终端运行,但没有效果。我也尝试过在CMD中使用类似的命令。
我在PC上没有管理员权限,并且发现我无法使用Windows资源监视器。这可能与问题有关,或者我的论点有问题吗?
额外信息:
当探查器失败时,在终端中出现以下错误
Profiler Agent: Waiting for connection on port 5140 (Protocol
version: 15)
Profiler Agent: Established connection with the tool
Profiler Agent: Local accelerated session
Profiler Agent Error: Redefinition failed for classes:
sun.nio.fs.NativeBuffer$Deallocator
sun.rmi.transport.DGCImpl$1
sun.rmi.transport.tcp.TCPTransport$AcceptLoop
sun.rmi.transport.DGCAckHandler$1
com.profiletest.Main
sun.nio.ch.FileChannelImpl$Unmapper
java.io.DeleteOnExitHook$1
java.util.ResourceBundle$RBClassLoader
java.util.concurrent.ThreadPoolExecutor$Worker
java.util.concurrent.ScheduledThreadPoolExecutor
$ScheduledFutureTask
java.lang.ref.Reference$ReferenceHandler
java.lang.ClassLoader
java.util.logging.LogManager$Cleaner
com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout
java.lang.ApplicationShutdownHooks$1
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler
java.util.concurrent.FutureTask
java.lang.ref.Finalizer$FinalizerThread
java.lang.reflect.Method
Profiler Agent Error: with message: Redefinition failed with
error 62
Check JVMTI documentation for this error code.
Debug: writing class file: sun.nio.fs.NativeBuffer
$Deallocator, into file: sun.nio.fs.NativeBuffer
$Deallocator.class
Debug: writing class file: sun.rmi.transport.DGCImpl$1, into
file: sun.rmi.transport.DGCImpl$1.class
Debug: writing class file:
sun.rmi.transport.tcp.TCPTransport$AcceptLoop, into file:
sun.rmi.transport.tcp.TCPTransport$AcceptLoop.class
Debug: writing class file: sun.rmi.transport.DGCAckHandler$1,
into file: sun.rmi.transport.DGCAckHandler$1.class
Debug: writing class file: com.profiletest.Main, into file:
com.profiletest.Main.class
Debug: writing class file: sun.nio.ch.FileChannelImpl
$Unmapper, into file: sun.nio.ch.FileChannelImpl
$Unmapper.class
Debug: writing class file: java.io.DeleteOnExitHook$1, into
file: java.io.DeleteOnExitHook$1.class
Debug: writing class file: java.util.ResourceBundle
$RBClassLoader, into file: java.util.ResourceBundle
$RBClassLoader.class
Debug: writing class file:
java.util.concurrent.ThreadPoolExecutor$Worker, into file:
java.util.concurrent.ThreadPoolExecutor$Worker.class
Debug: writing class file:
java.util.concurrent.ScheduledThreadPoolExecutor
$ScheduledFutureTask, into file:
java.util.concurrent.ScheduledThreadPoolExecutor
$ScheduledFutureTask.class
Debug: writing class file: java.lang.ref.Reference
$ReferenceHandler, into file: java.lang.ref.Reference
$ReferenceHandler.class
Debug: writing class file: java.lang.ClassLoader, into file:
java.lang.ClassLoader.class
Debug: writing class file: java.util.logging.LogManager
$Cleaner, into file: java.util.logging.LogManager
$Cleaner.class
Debug: writing class file:
com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout,
into file:
com.sun.jmx.remote.internal.ServerCommunicatorAdmin
$Timeout.class
Debug: writing class file:
java.lang.ApplicationShutdownHooks$1, into file:
java.lang.ApplicationShutdownHooks$1.class
Debug: writing class file:
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler, into
file: sun.rmi.transport.tcp.TCPTransport
$ConnectionHandler.class
Debug: writing class file: java.util.concurrent.FutureTask,
into file: java.util.concurrent.FutureTask.class
Debug: writing class file: java.lang.ref.Finalizer
$FinalizerThread, into file: java.lang.ref.Finalizer
$FinalizerThread.class
Debug: writing class file: java.lang.reflect.Method, into
file: java.lang.reflect.Method.class
最佳答案
java -Xverify:none -jar SimpleProfile.jar可以运行。我想我还没有穷尽所有选择。