jpos / tutorial

jPOS Tutorial
0 stars 1 forks source link

Fails to build due to Java incompatibility #1

Open sproctor opened 6 months ago

sproctor commented 6 months ago

I guess the jpos snapshot version isn't in a great state.

$ gradle run
> Task :jar FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':jar'.
> Could not resolve all files for configuration ':runtimeClasspath'.
   > Could not resolve org.jpos:jpos:3.0.0-SNAPSHOT.
     Required by:
         project :
      > No matching variant of org.jpos:jpos:3.0.0-SNAPSHOT:20240223.202237-12 was found. The consumer was configured to find a library for use during runtime, compatible with Java 17, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally but:
          - Variant 'apiElements' capability org.jpos:jpos:3.0.0-SNAPSHOT declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component for use during compile-time, compatible with Java 21 and the consumer needed a component for use during runtime, compatible with Java 17
              - Other compatible attribute:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
          - Variant 'javadocElements' capability org.jpos:jpos:3.0.0-SNAPSHOT declares a component for use during runtime, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 17)
                  - Doesn't say anything about its elements (required them packaged as a jar)
          - Variant 'runtimeElements' capability org.jpos:jpos:3.0.0-SNAPSHOT declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component, compatible with Java 21 and the consumer needed a component, compatible with Java 17
              - Other compatible attribute:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
          - Variant 'sourcesElements' capability org.jpos:jpos:3.0.0-SNAPSHOT declares a component for use during runtime, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 17)
                  - Doesn't say anything about its elements (required them packaged as a jar)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 418ms
3 actionable tasks: 3 executed
4r73m190r0s commented 4 months ago

I solved this error by going to IntelliJ IDEA Settings → Build, Execution, Deployment → Gradle → and set "Gradle JVM" to SDK 17 (which I have installed)