Summary: when trying to use Flight Recorder on a JFR-enabled OpenJDK8 JVM, a dialog opens asking if the user wants to unlock Commercial Features. Only once "yes" is selected in the dialog does JFR work as expected.
I've attached a screenshot of this happening using a JDK8 I patched and built myself.
After some digging, I think this is related to
JMC-6554. More specifically, this line change: https://github.com/openjdk/jmc/commit/4b315fe62adb44c5524b55cac2e286fa22324573#diff-0b04383b19ec0cdc6a41720dddc19a70R62
If I grab the Java information using
then I see:
As a result, the CommercialFeaturesServiceFactory returns a Hotspot23CommercialFeaturesService instead of a NoCommercialFeaturesService, because the ConnectionToolkit checks the vendor string to see if it contains "Oracle", which it does. The Hotspot23CommercialFeaturesService always returns true when returning hasCommercialFeatures(), so when it checks if the features are enabled, it returns false, causing the dialog to appear in order to have the user enable commercial features.
Additionally, the it seems OpenJDK11 doesn't complain this way because of an if-statement (in ConnectionToolkit) that forces NoCommercialFeaturesService to be used if the JDK version is 11 or higher. If I comment out that if-statement, JMC will also ask me to unlock Commercial Features on my Fedora supplied OpenJDK 11.
Unless I'm missing something here, is a potential fix just changing the check on "jvm.vendor" to "java.vm.name" ?