Eclipse not recognising Java-17

Viewed 7548

Hi today I installed java 17 and eclipse(with latest version- 2021‑09). But after all configuration it is showing JavaSE-16 as jdk version. I ignored it and started writing a program with sealed classes. Then it is showing an error. I managed to solve the problem by installing the Java-17 support plugin from eclipse marketplace. Is it possible in eclipse without installing anything.

3 Answers

The release notes state this:

Supports Java 17, including Pattern Matching for Switch (Preview), Sealed Classes, and more via Eclipse Marketplace

That means currently you have to install the plugin, later support will be included. You might also want to read this: https://www.eclipse.org/eclipse/news/4.21/jdt.php

The support should be official with Eclipse 4.22 (Q4 2021)

Java 17

Java 17 is out and Eclipse JDT supports Java 17 in 4.22.

The release notably includes the following Java 17 features:

  • JEP 306: Restore Always-Strict Floating-Point Semantics.
  • JEP 406: Pattern Matching for switch (Preview).
  • JEP 409: Sealed Classes (Final).

Please note that preview option should be on for preview language features. >For an informal introduction of the support, please refer to J**ava 17 Examples wiki**.

Related