title: spring-boot: Fatal error compiling: invalid target release: 17
body: <p>Just going through <a href="https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#getting-started.first-application.run" rel="nofollow noreferrer">spring-boot tutorial</a> and getting stuck on step 4.4.4 executing <code>$ mvn spring-boot:run</code></p>
  <p>Here's the error:</p>
  <pre><code>$ mvn spring-boot:run
  [INFO] Scanning for projects...
  [INFO] 
  [INFO] -----------------------&lt; com.example:myproject &gt;------------------------
  [INFO] Building myproject 0.0.1-SNAPSHOT
  [INFO] --------------------------------[ jar ]---------------------------------
  [INFO] 
  [INFO] &gt;&gt;&gt; spring-boot-maven-plugin:3.0.0-SNAPSHOT:run (default-cli) &gt; test-compile @ myproject &gt;&gt;&gt;
  [INFO] 
  [INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ myproject ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] Using 'UTF-8' encoding to copy filtered properties files.
  [INFO] skip non existing resourceDirectory /Users/dnatochy/development/springboot/testapp1/src/main/resources
  [INFO] skip non existing resourceDirectory /Users/dnatochy/development/springboot/testapp1/src/main/resources
  [INFO] 
  [INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ myproject ---
  [INFO] Changes detected - recompiling the module!
  [INFO] Compiling 1 source file to /Users/dnatochy/development/springboot/testapp1/target/classes
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time:  1.078 s
  [INFO] Finished at: 2022-07-26T21:27:48-07:00
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project myproject: Fatal error compiling: invalid target release: 17 -&gt; [Help 1]
  [ERROR] 
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  </code></pre>
  <p>Everything I can find on Google similar to this error points to the mismatch of java version used by maven, but this is not the case</p>
  <pre><code>$ java -version
  java version &quot;1.8.0_333&quot;
  Java(TM) SE Runtime Environment (build 1.8.0_333-b02)
  Java HotSpot(TM) 64-Bit Server VM (build 25.333-b02, mixed mode)
  
  $ javac -version
  javac 1.8.0_333
  
  $ mvn -v
  Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
  Maven home: /Users/myuser/tools/apache-maven-3.8.6
  Java version: 1.8.0_333, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_333.jdk/Contents/Home/jre
  Default locale: en_US, platform encoding: UTF-8
  OS name: &quot;mac os x&quot;, version: &quot;12.4&quot;, arch: &quot;x86_64&quot;, family: &quot;mac&quot;
  
  $ echo $JAVA_HOME
  /Library/Java/JavaVirtualMachines/jdk1.8.0_333.jdk/Contents/Home
  </code></pre>