Repository navigation
Java Maven JDK 17 not supported #825
Copy link
Copy link
Closed
Description
Hi, I'm making java (Maven) project that uses the latest JDK 17. I've set up this workflow, but every time it runs it exits after a few seconds. It seems that the problem is using JDK 17. Here's the log:
[2021-11-21 00:14:48] [autobuild] [INFO] Compiling 14 source files to /home/runner/work/Atosiak/Atosiak/target/classes
[2021-11-21 00:14:49] [autobuild] [INFO] ------------------------------------------------------------------------
[2021-11-21 00:14:49] [autobuild] [INFO] BUILD FAILURE
[2021-11-21 00:14:49] [autobuild] [INFO] ------------------------------------------------------------------------
[2021-11-21 00:14:49] [autobuild] [INFO] Total time: 12.623 s
[2021-11-21 00:14:49] [autobuild] [INFO] Finished at: 2021-11-21T00:14:49Z
[2021-11-21 00:14:49] [autobuild] [INFO] ------------------------------------------------------------------------
Error: 1-21 00:14:49] [autobuild] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Atosiak: Fatal error compiling: error: invalid target release: 17 -> [Help 1]
[2021-11-21 00:14:49] [autobuild] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Atosiak: Fatal error compiling
[2021-11-21 00:14:49] [autobuild] at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
[2021-11-21 00:14:49] [autobuild] at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
[2021-11-21 00:14:49] [autobuild] at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
[2021-11-21 00:14:49] [autobuild] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
[2021-11-21 00:14:49] [autobuild] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
And final lines:
Error: 1-21 00:14:49] [autobuild] [ERROR]
Error: 1-21 00:14:49] [autobuild] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
Error: 1-21 00:14:49] [autobuild] [ERROR]
Error: 1-21 00:14:49] [autobuild] [ERROR] For more information about the errors and possible solutions, please read the following articles:
Error: 1-21 00:14:49] [autobuild] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Error: 1-21 00:14:49] [ERROR] Spawned process exited abnormally (code 1; tried to run: [mvn, clean, package, -f, pom.xml, -B, -V, -e, -Dfindbugs.skip, -Dcheckstyle.skip, -Dpmd.skip=true, -Denforcer.skip, -Dmaven.javadoc.skip, -DskipTests, -Dmaven.test.skip.exec, -Dlicense.skip=true, -Drat.skip=true])
Error: We were unable to automatically build your code. Please replace the call to the autobuild action with your custom build steps. Failure invoking /opt/hostedtoolcache/CodeQL/0.0.0-20211025/x64/codeql/java/tools/autobuild.sh with arguments .
Exit code 1 and error was:
Picked up JAVA_TOOL_OPTIONS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false
CommandInvocationError: Failure invoking /opt/hostedtoolcache/CodeQL/0.0.0-20211025/x64/codeql/java/tools/autobuild.sh with arguments .
Exit code 1 and error was:
Picked up JAVA_TOOL_OPTIONS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false
at runTool (/home/runner/work/_actions/github/codeql-action/v1/lib/codeql.js:728:15)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Object.runAutobuild (/home/runner/work/_actions/github/codeql-action/v1/lib/codeql.js:464:13)
at async runAutobuild (/home/runner/work/_actions/github/codeql-action/v1/lib/autobuild.js:29:5)
at async run (/home/runner/work/_actions/github/codeql-action/v1/lib/autobuild-action.js:57:13)
at async runWrapper (/home/runner/work/_actions/github/codeql-action/v1/lib/autobuild-action.js:70:9)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
MathiasVP commentedon Nov 22, 2021
Hi @Zduniusz,
Thanks for your issue!
Have you set up a Java 17 environment on Actions using https://github.com/actions/setup-java?
Zduniusz commentedon Nov 25, 2021
Hi, thanks for your response. No, I haven't, I've kept it original. https://github.com/Zduniusz/Atosiak/blob/9ceeb8a38fd002ed3e56de8d9e69359956615092/.github/workflows/codeql-analysis.yml
MathiasVP commentedon Nov 25, 2021
I think it'll work if you add something like this to your workflow file:
chore(github): wire up jdk 17 in CI
chore(jdk): Add JDK 17 support (#45)
Tell CodeQL how to use JDK 17
Enable CodeQL (#5)
tell CodeQL how to use JDK 19
Updated CodeQL action to set up the correct version of Java
Configure CodeQL to build with Java 17
java 17 in codeql? github/codeql-action#825
Configure CodeQL to build with Java 17