Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8165732

Improve the error message when -javaagent option fails as java.instrument is not present

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • 11
    • 9
    • hotspot
    • svc

      $ jdk/bin/jlink --output image --module-path jdk/jmods --add-modules java.base

      $ image/bin/java -javaagent:agent.jar Hi
      Error occurred during initialization of VM
      Could not find agent library instrument on the library path, with error: dlopen(libinstrument.dylib, 1): image not found

      -javaagent is only supported when java.instrument module is present. The error message could be improved.

            gadams Gary Adams (Inactive)
            mchung Mandy Chung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: