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

jdeprscan does not work with JDK11

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      MacOS 12.5
      Java 11

      A DESCRIPTION OF THE PROBLEM :
      I am using Java 11 and trying to run jdeprscan. Here is my command line:

      /Library/Java/JavaVirtualMachines/jdk-11.0.14.jdk/Contents/Home/bin/jdeprscan --class-path "/Users/d..." --release 11 myjar-20.5.1-SNAPSHOT.jar

      I resolved all the dependencies using the --class-path but I always get this reported:

      error: cannot resolve Methodref java/lang/invoke/MethodHandle.invokeExact:(Ljava/lang/Object;)Ljava/lang/Object;

      and then it stopped because I have not resolved all the dependencies.

      A bit of investigation says that MethodHandle is in java.base.jmod and maybe java.desktop.jmod, so I un'tarred their classes into my target/classes and added it to the class-path e.g. --class-path "/Users/d...:$PWD/target/classes".

      This did not work. There is also no way to tell jdeprscan to use the jmod. I tried with the following Oracle/OpenJDK and the result is the same

      /usr/local/Cellar/openjdk@11/11.0.16.1/bin/jdeprscan
      /usr/local/Cellar/openjdk/18.0.2.1/bin/jdeprscan
      /Library/Java/JavaVirtualMachines/jdk-11.0.14.jdk/Contents/Home/bin/jdeprscan
      /Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/bin/jdeprscan

      I tried to use it in org.apache.maven.plugins:maven-jdeprscan-plugin:3.0.0-alpha-1 with:

          <build>
              <plugins>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-jdeprscan-plugin</artifactId>
                      <version>3.0.0-alpha-1</version>
                      <executions>
                          <execution>
                              <id>exe_scan</id>
                              <configuration>
                                  <release>11</release>
                                  <failOnWarning>false</failOnWarning>
                              </configuration>
                              <goals>
                                  <goal>jdeprscan</goal>
                              </goals>
                          </execution>
                      </executions>
                  </plugin>

      But it gives exactly the same message:
      [INFO] --- maven-jdeprscan-plugin:3.0.0-alpha-1:jdeprscan (exe_scan) @ techsupport-main ---
      [INFO]
      Directory /Users/davidnewcomb/GOOGLE/gitlab/05_G4_Sources/techsupport/techsupport-main/target/classes:
      [WARNING] JDeprScan Warnings
      [WARNING] error: cannot resolve Methodref java/lang/invoke/MethodHandle.invokeExact:(Ljava/lang/Object;)Ljava/lang/Object;
      [INFO]

      I know that maven-jdeprscan-plugin is nothing to do with you, I just trying to demonstrate that it has broken stuff downstream of you.

      REGRESSION : Last worked in version 18.0.2.1


      FREQUENCY : always


            smarks Stuart Marks
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: