I want to run a java application with JFR enabled. When I start my application as below java -XX:+UnlockCommercialFeatures -XX:StartFlightRecording
I get following erro
No it does not. As per the release notes for openjdk8u262, it is supported in OpenJDK 8 update 262.
New features - JDK-8223147: JFR Backport
Oracle open-sourced both Flight Recorder and Mission Recorder as sub-projects housed on the OpenJDK project. Builds available from vendors such as Azul Systems, Oracle, and others. Some may be free-of-cost, some may not; read the terms.
Azul Systems, Inc. is currently shipping their Zulu Community product built on OpenJDK. Java Flight Recorder and Mission Control are both included for Java 8 according to their feature matrix.
Also included in their commercial product, Zulu Enterprise.
Caveat: I have not used Flight Recorder with either Zulu. Just found it from some web searching.
By the way, TLS improvements are also being back-ported to Java 8.