question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

3.4.1 Seems to require Java 15, becomes incompatible with lower Java versions

See original GitHub issue

I don’t see what in the diff caused the incompatibility https://github.com/jeremymailen/kotlinter-gradle/compare/3.4.0...3.4.1, but when trying to use recent plugin version in an environment with lower java version, it fails with a message similar to:

> Could not resolve all artifacts for configuration ':buildSrc:classpath'.
   > Could not resolve org.jmailen.gradle:kotlinter-gradle:3.4.1.
     Required by:
         project :buildSrc > org.jmailen.kotlinter:org.jmailen.kotlinter.gradle.plugin:3.4.1
      > No matching variant of org.jmailen.gradle:kotlinter-gradle:3.4.1 was found. The consumer was configured to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.0' but:
          - Variant 'apiElements' capability org.jmailen.gradle:kotlinter-gradle:3.4.1 declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 15 and the consumer needed a runtime of a component compatible with Java 11
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.0')
          - Variant 'runtimeElements' capability org.jmailen.gradle:kotlinter-gradle:3.4.1 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 15 and the consumer needed a component compatible with Java 11
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.0')

The build passes on Java 15. Sample failed run

I’m quite sure that’s not an expected behavior change so I’m reporting an issue here.

btw. the new Gradle Toolchains feature might be helpful here https://docs.gradle.org/current/userguide/toolchains.html

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jeremymailencommented, Apr 28, 2021

Thank you, this is helpful. I guess now jar compatibility requires more than just bytecode – declaring which JDK apis are required by the component. Will try to fix tomorrow.

0reactions
mateuszkwiecinskicommented, Apr 29, 2021

Thanks! I can confirm it works, even on Java 8 🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incompatible Java Versions for WindowBuilder - Stack Overflow
I Installed WindowBuilder on Eclipse to create a Graphic User Interface for a program. When I go to the 'Design' tab the following...
Read more >
How to Fix UnsupportedClassVersion Error in Java - Rollbar
The UnsupportedClassVersionError in Java occurs when the JVM attempts to read a malformed or otherwise erroneous class file.
Read more >
Compatibility Guide for JDK 8 - Oracle
This document discusses types of potential incompatibilities relating to the JDK 8 release of the Java platform.
Read more >
Building Java & JVM projects - Gradle User Manual
The simplest build script for a Java project applies the Java Library Plugin and optionally sets the project version and selects the Java...
Read more >
Update Java runtime settings on Windows
In the Java Control Panel, click on the Java tab. Verify that the latest Java Runtime version is enabled by checking the Enabled...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found