简体   繁体   English

OpenJDK 11 是否支持 Java Flight Recorder?

[英]Does OpenJDK 11 support Java Flight Recorder?

Following this post :这篇文章之后

jfr is supported natively in openjdk 11 openjdk 11 原生支持 jfr

and it is confirmed by the features list of OpenJDK 11 :并由OpenJDK 11 的功能列表确认:

328: Flight Recorder 328:飞行记录仪

However, from this DZone article , about using JFR-linked option -XX:+UnlockCommercialFeatures :但是,从这篇 DZone 文章中,关于使用 JFR 链接选项-XX:+UnlockCommercialFeatures

OpenJDK doesn't recognize this option OpenJDK 无法识别此选项

And when I try for ex.当我尝试为前任。 with Gradle: ./gradlew clean -Dorg.gradle.jvmargs="-XX:+UnlockCommercialFeatures" I get使用 Gradle: ./gradlew clean -Dorg.gradle.jvmargs="-XX:+UnlockCommercialFeatures"我得到

Process command line: C:\\Program Files\\AdoptOpenJDK\\jdk-11.0.11.9-hotspot\\bin\\java.exe -XX:+UnlockCommercialFeatures (...)处理命令行:C:\\Program Files\\AdoptOpenJDK\\jdk-11.0.11.9-hotspot\\bin\\java.exe -XX:+UnlockCommercialFeatures (...)

Unrecognized VM option 'UnlockCommercialFeatures'无法识别的 VM 选项“UnlockCommercialFeatures”

What am I missing here ?我在这里错过了什么?

JFR was a commercial feature in Oracle Java up to Java 1.8 that needed to be specially enabled (using -XX:+UnlockCommercialFeatures ). JFR 是 Oracle Java 中的一项商业功能,直到 Java 1.8,需要专门启用(使用-XX:+UnlockCommercialFeatures )。

With Java 11 and later it is no longer a commercial feature so you don't need this flag.在 Java 11 及更高版本中,它不再是一项商业功能,因此您不需要此标志。

Actually the linked article states:实际上链接的文章指出:

JFR Packaging Differences JFR 封装差异
Oracle JDK 11 emits a warning when using the -XX:+UnlockCommercialFeatures option, whereas OpenJDK doesn't recognize this option and reports an error. Oracle JDK 11 在使用-XX:+UnlockCommercialFeatures选项时发出警告,而 OpenJDK 无法识别此选项并报告错误。

And the example below that the author shows doesn't use the -XX:+UnlockCommercialFeatures .下面作者展示的示例没有使用-XX:+UnlockCommercialFeatures

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

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