简体   繁体   English

不支持 Java 飞行记录器文件格式

[英]Java Flight Recorder File Format Not Supported

I am trying to profile the run of my Java code using Java Flight Recorder (JFR).我正在尝试使用 Java Flight Recorder (JFR) 来分析我的 Java 代码的运行情况。 To do this, I am using the terminal command:为此,我使用终端命令:

java -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:StartFlightRecording=duration=500s,filename=myrecording.jfr -jar runnableJARFile.jar

This runs my program & seemingly creates the .jfr recording file, however when I try to open it in Java Mission Control, I get the error:这会运行我的程序并似乎创建了 .jfr 录音文件,但是当我尝试在 Java Mission Control 中打开它时,出现错误:

'Loading events from myrecording.jfr' has encountered a problem.

The file format of myrecording.jfr is not supported. Try with a more recent version of Mission Control.

However, I have checked and I am running JMC 6.0.0 (which appears to be the latest) version, as well as JDK 11.0.0 (also seems to be the latest version).但是,我已经检查过并且正在运行 JMC 6.0.0(似乎是最新版本)以及 JDK 11.0.0(似乎也是最新版本)。 When I check for updates, both show to be up to date.当我检查更新时,两者都显示为最新。

Any ideas how to get the JFR file to open in JMC?任何想法如何让 JFR 文件在 JMC 中打开?

NOTE: I am using Eclipse as an IDE, however can't seem to get the flight recording to start simultaneously with the program;注意:我使用 Eclipse 作为 IDE,但是似乎无法让飞行记录与程序同时开始; this is why I am using terminal.这就是我使用终端的原因。 (Running OS X El Capitan) (运行 OS X El Capitan)

Try the early access build of JMC 7 (which is now open source).尝试 JMC 7 的早期访问版本(现已开源)。 That is what's designed to work with JDK 11 (and earlier) https://jdk.java.net/jmc/这就是设计用于 JDK 11(及更早版本) https://jdk.java.net/jmc/

(JMC is generally backwards compatible) (JMC 通常向后兼容)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM