0

I am invoking my java code via Eclipse External Tools as an ant target.

I want to monitor the JVM with JMC (Mission Control) and hence start up the Eclipse External Tools with arguments:

"-XX:+UnlockCommercialFeatures -XX:+FlightRecorder".

However, when I run it, the first error in the log file is:

"Unknown argument: -XX:+UnlockCommercialFeatures -XX:+FlightRecorder"

Also, when I run the flight recorder on this process, it complains:

"Flight Recorder features are not enabled. To enable this you need to use a Java 7u4 or later JVM started with -XX:+UnlockCommercialFeatures -XX:+FlightRecorder."

Looks like I am not setting the args in the correct place in eclipse.

Edit after the answer: If I invoke Java from commandline it looks fine, but when I invoke from eclipse external tools, that is the issue. Attached screenshot.Eclipse External Tools invoked with JVM args for JMC

2 Answers2

0

You are probably running with a non HotSpot JVM, or one prior to JDK 7u4, perhaps mistakenly.

I copied your command line argument above and ran it on my machine with 1.7.0_60 with the following output:

 C:\JVMs\jdk1.7.0_60\bin>java -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -version
 java version "1.7.0_60"
 Java(TM) SE Runtime Environment (build 1.7.0_60-b33)
 Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)

 C:\JVMs\jdk1.7.0_60\bin>
Kire Haglin
  • 6,569
  • 22
  • 27
0

If you want to do a flightrecording of your ant build, move the "-XX:+UnlockCommercialFeatures -XX:+FlightRecorder" flags to the JRE tab, and place them without quotes in the VM Arguments field.

Klara
  • 2,935
  • 22
  • 19