JDK-8060200 : Enabling JFR support in Java WebStart
  • Type: Enhancement
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 7u67,8u20
  • Priority: P2
  • Status: Resolved
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2014-10-13
  • Updated: 2017-05-26
  • Resolved: 2017-05-26
Related Reports
Relates :  
Sub Tasks
JDK-8075744 :  
Description
A request from the field: is it possible to use JFR in the context of an @ applet/JNLP?
Trying it currently leads to failure.

More precisely, it has been found that the only properties specified in the JNLP file that are effectively passed to the client JVM are the supported options as advertised in:
http://docs.oracle.com/javase/8/docs/technotes/guides/javaws/developersguide/syntax.html#resources
All other options are silently dropped. These dropped options include the JFR specific options.

This enhancement is about adding support for the JFR options (and thus introduce support for JFR) in applet/JNLP.
This includes but is not limited to:
-XX:+UnlockCommercialFeatures
-XX:+FlightRecorder
-XX:StartFlightRecording=...
-XX:FlightRecorderOptions=... 
Comments
We won't fix (ie won't make these secure vm-args) - but we will document the above options to enable JFR in Java Web STart / Java Plugin
26-05-2017

I verified that in JDK9, setting env variable JAVAWS_VM_ARGS works in javaws apps: export JAVAWS_VM_ARGS='-XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:StartFlightRecording=duration=60s,filename=c:\test\recording.jfr' Then running javaws app causes c:\test\recording.jfr to be created. I can also verify setting those args in JCP for the VM works. in plugin the corresponding env variable is "_JPI_VM_OPTIONS" I can also verify that setting JAVA_TOOL_OPTIONS also works: export JAVA_TOOL_OPTIONS='-XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:StartFlightRecording=duration=60s,filename=c:\test\tools_option.jfr' then running any javaws app c:\test\tools+option.jfr is created. in summary: JAVAWS_VM_ARGS works in Java Web Start _JPI_VM_OPTIONS works in plugin JAVA_TOOL_OPTIONS works in both.
26-05-2017

Another environment variable that may work, and which is ws-specific, is JAVAWS_VM_ARGS. Again, didn't try it.
16-02-2017

I haven't tried this myself, but wouldn't using the JAVA_TOOL_OPTIONS environment variable be a viable workaround?
20-03-2015

Workaround, courtesy of Brian Cox: A less desirable solution but effective in implementations using a pre 8u40 JVM is to enable the flags in the Java control panel, details below. A word of warning, with these settings all JVM usage going forward will have JFR/JMC enabled web start or not. ��� From Windows Control panel select Java ��� The Java Control Panel is started. ��� Click on the Java Tab and then View��� ��� This will open the Java Runtime Environment Settings dialog ��� The dialog will show all JVM���s installed ��� Identify the JVM being used by web start, or repeat for all ��� In the Runtime Parameters you will add the commercial features flight recorder flags: -XX:+UnlockCommercialFeatures -XX:+FlightRecorder
27-02-2015

And now an e-mail from peter.doschkinow@oracle.com. Can we have an ETA on this?
27-02-2015

Just got an e-mail from brian.cox@oracle.com who has a customer requesting the same thing.
06-02-2015

See also BUG 19792968 - Enabling JFR support in Java WebStart http://www.oracle.com/technetwork/java/javase/2col/jmc-relnotes-2004763.html#limt Limitations JMC does not include or run with a security manager, so a user must ensure to run the JMC client in a secure environment. ----- Although running in a secure environment, this client environment does not meet this advertised limitation.
13-10-2014