1

I have launched a project which was currently running in jdk 17.0.3, in the new jdk 18.0.1.1 and got the following error:

Fehler: Beim Laden der Klasse launching.Main ist ein LinkageError aufgetreten
    java.lang.UnsupportedClassVersionError: launching/Main (class file version 61.65535) was compiled with preview features that are unsupported. This version of the Java Runtime only recognizes preview features for class file version 62.65535

I have tried cleaning and rebuilding, and the preview features are also enabled for the new version. (Both in the vm args and the .settings-file). Playing around with the jre-settings hasn't helped, and I'm afraid to break something.

xtay2
  • 453
  • 3
  • 14
  • If you use preview features, make sure that the `--release` option is the same version as the JDK you want to run it on. – Johannes Kuhn May 03 '22 at 18:29
  • @JohannesKuhn The --release option is on, but I find no eclipse-settings that specify the version. – xtay2 May 03 '22 at 18:31
  • 2
    The settings are all on the same page, right where the “Use '--release' option” and “Enable preview features” toggles are, there’s the “Compiler compliance level” setting. But to use preview features of JDK 18, you need specific support for targeting JDK 18 from Eclipse. – Holger May 04 '22 at 08:19

1 Answers1

0

Installing the newest version of eclipse did the thing, as the old one wasn't supporting jdk18.

xtay2
  • 453
  • 3
  • 14