mvn spring-boot:run を実行したときに「リリース・バージョン17はサポートされていません」でエラーになる

実現したいこと

Java17のバージョンでSpringを起動させたい

発生している問題・分からないこと

java --version

java 17.0.10 2024-01-16 LTS Java(TM) SE Runtime Environment (build 17.0.10+11-LTS-240) Java HotSpot(TM) 64-Bit Server VM (build 17.0.10+11-LTS-240, mixed mode, sharing)

mvn --version

Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec Java version: 15.0.1, vendor: N/A, runtime: /usr/local/Cellar/openjdk/15.0.1/libexec/openjdk.jdk/Contents/Home Default locale: ja_JP, platform encoding: UTF-8 OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"

エラーメッセージ

error

1User@t-Mac repositoryName % mvn spring-boot:run 2[INFO] Scanning for projects... 3[INFO] 4[INFO] -------------------< com.example:soro-syoku-backend >------------------- 5[INFO] Building soro-syoku-backend 0.0.1-SNAPSHOT 6[INFO] --------------------------------[ jar ]--------------------------------- 7[INFO] 8[INFO] >>> spring-boot-maven-plugin:3.2.5:run (default-cli) > test-compile @ repositoryName >>> 9[INFO] 10[INFO] --- maven-resources-plugin:3.3.1:resources (default-resources) @ repositoryName --- 11[INFO] Copying 1 resource from src/main/resources to target/classes 12[INFO] Copying 0 resource from src/main/resources to target/classes 13[INFO] 14[INFO] --- maven-compiler-plugin:3.13.0:compile (default-compile) @ repositoryName --- 15[INFO] Recompiling the module because of changed source code. 16[INFO] Compiling 1 source file with javac [debug parameters release 17] to target/classes 17[INFO] ------------------------------------------------------------------------ 18[INFO] BUILD FAILURE 19[INFO] ------------------------------------------------------------------------ 20[INFO] Total time: 1.048 s 21[INFO] Finished at: 2024-05-01T13:06:41+09:00 22[INFO] ------------------------------------------------------------------------ 23[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project repositoryName: Fatal error compiling: エラー: リリース・バージョン17はサポートされていません -> [Help 1] 24[ERROR] 25[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 26[ERROR] Re-run Maven using the -X switch to enable full debug logging. 27[ERROR] 28[ERROR] For more information about the errors and possible solutions, please read the following articles: 29[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

該当のソースコード

特になし

試したこと・調べたこと

上記の詳細・結果

JavaのバージョンとMavenが見ているJavaのバージョンに差異があるため、JAVA_HOMEの値を17に合わせて、更新し、再起動をかけても15のままになっている。

補足

特になし

コメントを投稿

0 コメント