openimaj / openimaj

The OpenIMAJ source code repository
http://www.openimaj.org
Other
326 stars 116 forks source link

jtemp-maven-plugin 1.2 API incompatibility: #377

Open shadowwalkersteam opened 1 week ago

shadowwalkersteam commented 1 week ago

Hello, I'm trying to compile the source code by running mvn install but I'm getting the errors. I have JDK 1.8 installed and mvn -version result is

Apache Maven 3.9.4 (dfbb324ad4a7c8fb0bf182e6d91b0ae20e3d2dd9)
Maven home: /usr/local/Cellar/maven/3.9.4/libexec
Java version: 20.0.1, vendor: Homebrew, runtime: /usr/local/Cellar/openjdk/20.0.1/libexec/openjdk.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "14.4.1", arch: "x86_64", family: "mac"

The error I'm getting is this

[ERROR] Failed to execute goal uk.ac.soton.ecs.jsh2:jtemp-maven-plugin:1.2:generate (default) on project core: Execution default of goal uk.ac.soton.ecs.jsh2:jtemp-maven-plugin:1.2:generate failed: Unable to load the mojo 'generate' in the plugin 'uk.ac.soton.ecs.jsh2:jtemp-maven-plugin:1.2' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: null
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>uk.ac.soton.ecs.jsh2:jtemp-maven-plugin:1.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/zohaib/.m2/repository/uk/ac/soton/ecs/jsh2/jtemp-maven-plugin/1.2/jtemp-maven-plugin-1.2.jar
[ERROR] urls[1] = file:/Users/zohaib/.m2/repository/org/codehaus/gmaven/gmaven-mojo/1.3/gmaven-mojo-1.3.jar
[ERROR] urls[2] = file:/Users/zohaib/.m2/repository/org/codehaus/gmaven/runtime/gmaven-runtime-api/1.3/gmaven-runtime-api-1.3.jar
[ERROR] urls[3] = file:/Users/zohaib/.m2/repository/org/codehaus/gmaven/feature/gmaven-feature-api/1.3/gmaven-feature-api-1.3.jar
[ERROR] urls[4] = file:/Users/zohaib/.m2/repository/org/codehaus/gmaven/runtime/gmaven-runtime-1.5/1.3/gmaven-runtime-1.5-1.3.jar
[ERROR] urls[5] = file:/Users/zohaib/.m2/repository/org/codehaus/gmaven/feature/gmaven-feature-support/1.3/gmaven-feature-support-1.3.jar
[ERROR] urls[6] = file:/Users/zohaib/.m2/repository/org/codehaus/gmaven/runtime/gmaven-runtime-support/1.3/gmaven-runtime-support-1.3.jar
[ERROR] urls[7] = file:/Users/zohaib/.m2/repository/org/sonatype/gshell/gshell-io/2.0/gshell-io-2.0.jar
[ERROR] urls[8] = file:/Users/zohaib/.m2/repository/org/sonatype/gossip/gossip/1.0/gossip-1.0.jar
[ERROR] urls[9] = file:/Users/zohaib/.m2/repository/com/thoughtworks/qdox/qdox/1.10/qdox-1.10.jar
[ERROR] urls[10] = file:/Users/zohaib/.m2/repository/jline/jline/0.9.94/jline-0.9.94.jar
[ERROR] urls[11] = file:/Users/zohaib/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.1/plexus-interpolation-1.1.jar
[ERROR] urls[12] = file:/Users/zohaib/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.jar
[ERROR] urls[13] = file:/Users/zohaib/.m2/repository/org/codehaus/groovy/groovy-all/1.6.9/groovy-all-1.6.9.jar
[ERROR] urls[14] = file:/Users/zohaib/.m2/repository/junit/junit/3.8.2/junit-3.8.2.jar
[ERROR] urls[15] = file:/Users/zohaib/.m2/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.jar
[ERROR] urls[16] = file:/Users/zohaib/.m2/repository/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------
[ERROR] : ExceptionInInitializerError: Unable to make protected void java.lang.Object.finalize() throws java.lang.Throwable accessible: module java.base does not "opens java.lang" to unnamed module @6e466fdf
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :core
jonhare commented 1 week ago

You’re actually using JDK 20 according to the stack trace - recent JDKs limit the ability to do certain reflection operations (including something deep in the plexus plugin that causes this issue). Simplest solution would be to switch to jdk 1.8 (although 11 and 12 might also work) just to compile the source.

Sent from my iPhone

On 13 May 2024, at 16:26, Shadow Walkers @.***> wrote:

 CAUTION: This e-mail originated outside the University of Southampton.

Hello, I'm trying to compile the source code by running mvn install but I'm getting the errors. I have JDK 1.8 installed and mvn -version result is

Apache Maven 3.9.4 (dfbb324ad4a7c8fb0bf182e6d91b0ae20e3d2dd9) Maven home: /usr/local/Cellar/maven/3.9.4/libexec Java version: 20.0.1, vendor: Homebrew, runtime: /usr/local/Cellar/openjdk/20.0.1/libexec/openjdk.jdk/Contents/Home Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "14.4.1", arch: "x86_64", family: "mac"

The error I'm getting is this

[ERROR] Failed to execute goal uk.ac.soton.ecs.jsh2:jtemp-maven-plugin:1.2:generate (default) on project core: Execution default of goal uk.ac.soton.ecs.jsh2:jtemp-maven-plugin:1.2:generate failed: Unable to load the mojo 'generate' in the plugin 'uk.ac.soton.ecs.jsh2:jtemp-maven-plugin:1.2' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: null [ERROR] ----------------------------------------------------- [ERROR] realm = plugin>uk.ac.soton.ecs.jsh2:jtemp-maven-plugin:1.2 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy [ERROR] urls[0] = file:/Users/zohaib/.m2/repository/uk/ac/soton/ecs/jsh2/jtemp-maven-plugin/1.2/jtemp-maven-plugin-1.2.jar [ERROR] urls[1] = file:/Users/zohaib/.m2/repository/org/codehaus/gmaven/gmaven-mojo/1.3/gmaven-mojo-1.3.jar [ERROR] urls[2] = file:/Users/zohaib/.m2/repository/org/codehaus/gmaven/runtime/gmaven-runtime-api/1.3/gmaven-runtime-api-1.3.jar [ERROR] urls[3] = file:/Users/zohaib/.m2/repository/org/codehaus/gmaven/feature/gmaven-feature-api/1.3/gmaven-feature-api-1.3.jar [ERROR] urls[4] = file:/Users/zohaib/.m2/repository/org/codehaus/gmaven/runtime/gmaven-runtime-1.5/1.3/gmaven-runtime-1.5-1.3.jar [ERROR] urls[5] = file:/Users/zohaib/.m2/repository/org/codehaus/gmaven/feature/gmaven-feature-support/1.3/gmaven-feature-support-1.3.jar [ERROR] urls[6] = file:/Users/zohaib/.m2/repository/org/codehaus/gmaven/runtime/gmaven-runtime-support/1.3/gmaven-runtime-support-1.3.jar [ERROR] urls[7] = file:/Users/zohaib/.m2/repository/org/sonatype/gshell/gshell-io/2.0/gshell-io-2.0.jar [ERROR] urls[8] = file:/Users/zohaib/.m2/repository/org/sonatype/gossip/gossip/1.0/gossip-1.0.jar [ERROR] urls[9] = file:/Users/zohaib/.m2/repository/com/thoughtworks/qdox/qdox/1.10/qdox-1.10.jar [ERROR] urls[10] = file:/Users/zohaib/.m2/repository/jline/jline/0.9.94/jline-0.9.94.jar [ERROR] urls[11] = file:/Users/zohaib/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.1/plexus-interpolation-1.1.jar [ERROR] urls[12] = file:/Users/zohaib/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.jar [ERROR] urls[13] = file:/Users/zohaib/.m2/repository/org/codehaus/groovy/groovy-all/1.6.9/groovy-all-1.6.9.jar [ERROR] urls[14] = file:/Users/zohaib/.m2/repository/junit/junit/3.8.2/junit-3.8.2.jar [ERROR] urls[15] = file:/Users/zohaib/.m2/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.jar [ERROR] urls[16] = file:/Users/zohaib/.m2/repository/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.jar [ERROR] Number of foreign imports: 1 [ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]] [ERROR] [ERROR] ----------------------------------------------------- [ERROR] : ExceptionInInitializerError: Unable to make protected void java.lang.Object.finalize() throws java.lang.Throwable accessible: module java.base does not "opens java.lang" to unnamed module @6e466fdf [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :core

— Reply to this email directly, view it on GitHubhttps://github.com/openimaj/openimaj/issues/377, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAIWYVZ4WCAHGRAMZA6MLHDZCDLSZAVCNFSM6AAAAABHUOB5G2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGI4TGMJUGMZTEMQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

shadowwalkersteam commented 1 week ago

it worked with jdk 1.8, I had multiple JDK installed and I set the JAVA_HOME to 1.8 JDK and now it is fine.

shadowwalkersteam commented 1 week ago

One thing more, Can you please update libOpenImajGrabber.dylib with minimum SDK greater than 10.9? Currently I was getting error from Apple Notarization due to SDK version less than 10.9.