1

I'm trying to figure out how to use the GraalVM native image agent with a Quarkus app running via mvn quarkus:dev.

I tried running:

mvn quarkus:dev -Djvm.args="-agentlib:native-image-agent=config-output-dir=native-image-config"

However I get the error:

ERROR: JDWP unable to get necessary JVMTI capabilities.

Any tips?

My version of Java:

openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment GraalVM CE 20.2.0 (build 11.0.8+10-jvmci-20.2-b03)
OpenJDK 64-Bit Server VM GraalVM CE 20.2.0 (build 11.0.8+10-jvmci-20.2-b03, mixed mode, sharing)
CowZow
  • 1,275
  • 2
  • 17
  • 36

1 Answers1

2

By default mvn quarkus:dev enables debug with -Xrunjdwp, something like -Xrunjdwp:transport=dt_socket,address=0.0.0.0:5005,server=y,suspend=n

Then you stumble upon an issue described in this answer -- in short JDWP and JVMTI don't seem to work together well.

You can disable debug with passing -Ddebug=false and then it works. Something like this:

mvn quarkus:dev -Ddebug=false -Djvm.args="-agentlib:native-image-agent=config-output-dir=native-image-config"
Oleg Šelajev
  • 3,530
  • 1
  • 17
  • 25