Welcome to the Linux Foundation Forum!

Instrumentation of the Java (Spring Boot) Component (1) - error with "mvn clean package" command

I got this error:

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project todobackend-automatic: Fatal error compiling: error: release version 21 not supported -> [Help 1]

I reviewed java and maven version:

$ java -version
openjdk version "21.0.5" 2024-10-15
OpenJDK Runtime Environment (build 21.0.5+11-Ubuntu-1ubuntu124.04)
OpenJDK 64-Bit Server VM (build 21.0.5+11-Ubuntu-1ubuntu124.04, mixed mode, sharing)

$ mvn -v
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: /opt/apache-maven-3.9.9
Java version: 21.0.5, vendor: Ubuntu, runtime: /usr/lib/jvm/java-21-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.8.0-51-generic", arch: "amd64", family: "unix"

$ echo $JAVA_HOME
/usr/lib/jvm/java-21-openjdk-amd64

I'm working with Ubuntu 24.04 and VS code

Regards

Answers

  • Posts: 2

    I have the same error

  • You probably have mismatch of versions somewhere. Are you running the maven from any IDE. IDE may have default versions which are different.
    Do you have code committed to github, to have a look.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training