I had this error in Eclipse: I had updated the JDK to 21 (keeping Java 8 and 17 alongside), but I had not updated the Eclipse plugins to support this. After an update, these errors went away.