Skip to content

Make the project at least compilable on newer JDKs #1350

Open
@php-coder

Description

@php-coder

Reported by @milik27:

While we don't support JDK 11 (#1158) and JDK 17 (#1556) yet we should look and try to fix the compilation at least. This should help to new contributors to work with project (even to just compile frontend).

At this moment, compilation fails on JDK14:

image

This thread might be helpful: https://stackoverflow.com/questions/59097317/warning-options-bootstrap-class-path-not-set-in-conjunction-with-source-8


TODO:

  • jdk11 and jdk17: fix Warning: bootstrap class path not set in conjunction with -source 8 (log); solution: pass <source>/<target> parameter to maven-compiler-plugin on JDK8 only and pass <release> on 11 and 17
  • jdk11: fix Error: Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.5:testCompile (default) on project mystamps: Error occurred while calling a method on a Groovy class from classpath. InvocationTargetException: BUG! exception in phase 'class generation' in source unit 'src/test/groovy/ru/mystamps/web/feature/site/CronServiceImplTest.groovy' unsupported Target MODULE (log)
  • jdk17 only: deal with java.lang.IllegalAccessError: class com.google.errorprone.ErrorProneJavacPlugin (in unnamed module @0x510e4d79) cannot access class com.sun.tools.javac.api.BasicJavacTask (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.api to unnamed module @0x510e4d79 (log); solution: pass extra options to maven-compiler-plugin (see http://errorprone.info/docs/installation)
  • jdk17: fix java.lang.NoSuchMethodError: 'java.lang.Iterable com.sun.tools.javac.code.Scope$WriteableScope.getSymbolsByName(com.sun.tools.javac.util.Name, com.sun.tools.javac.util.Filter)' (log); solution: update error-prone to >=2.7.1 (Update error-prone to 2.24.0 #1440)
  • jdk17: fix java.lang.reflect.InaccessibleObjectException: 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 @109a452c during gmavenplus-plugin:1.5:testCompile (log)

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions