Does not work with JDK 8 bsed project
See original GitHub issueThe plugin is built on Java 11, so not possible to use with a project using jdk 8.
Throws exception,
[ERROR] Failed to execute goal se.kth.castor:depclean-maven-plugin:1.1.0:depclean (default) on project idsk-commons-media: Execution default of goal se.kth.castor:depclean-maven-plugin:1.1.0:depclean failed: An API incompatibility was encountered while executing se.kth.castor:depclean-maven-plugin:1.1.0:depclean: java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer;
Issue Analytics
- State:
- Created 3 years ago
- Comments:18 (7 by maintainers)
Top Results From Across the Web
Compatibility Guide for JDK 8 - Oracle
Java SE 8 is strongly compatible with previous versions of the Java platform. Almost all existing programs should run on Java SE 8...
Read more >JavaFX troubleshoot: JDK 8 project is not working on JDK 9/10
This video solves the problem of not working JavaFX project which builds on JDK 8.this video also gives the solution to the error:Error: ......
Read more >Is it possible to select JDK 8 for Java project in Visual Studio ...
Build path specifies execution environment JavaSE-1.8. There are no JREs installed in the workspace that are strictly compatible with this ...
Read more >Building Java & JVM projects - Gradle User Manual
If you don't have much experience with building JVM-based projects with Gradle, take a look at the Java ... Gradle can only run...
Read more >Java Versions and Features - Marco Behler
Legacy projects in companies are often stuck with using Java 8 (see ... It obviously does not work the other way around, say...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Minor release is coming soon…
I get the same issue with version
1.1.1
so I tried to investigate a little bit more.Error is related probably to usage of
java.nio.ByteBuffer
in: https://github.com/castor-software/depclean/blob/master/depclean-core/src/main/java/se/kth/depclean/core/analysis/asm/ConstantPoolParser.javaA comment mention a workaround to this issue but is not implemented.
I run
javap -verbose ConstantPoolParser
onConstantPoolParser.class
packaged indepclean-core-1.1.1.jar
and get the following output:According to https://en.wikipedia.org/wiki/Java_class_file#General_layout this confirm that this is some byte code targeting Java 8 even if
META-INF/MANIFEST.MF
packaged indepclean-core-1.1.1.jar
mentionBuild-Jdk: 15.0.1
: JDK 15 can generate byte code for Java 8.An explanation about this behavior can be found in https://github.com/eclipse/jetty.project/issues/3244#issuecomment-495322586
Actually current pom.xml specify source and target (https://github.com/castor-software/depclean/blob/master/pom.xml#L19) but if Java 9 or higher is used to build the project it should specify the release option (
maven.compiler.release
) see https://stackoverflow.com/a/43103038/2440340I will shortly create a pull request that fix the issue and allow successful build on Java 9 or higher (but note that build will failed with Java 8) with error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project depclean-core: Fatal error compiling: invalid flag: --release -> [Help 1]
)I’m not sure if there is an easy solution to allow build of the project with both Java 8 and Java 9+ versions. I guess that requiring Java 9+ version for building is not a big issue and that compatibility with Java 8+ version is what is important here.