eclipse-jdt / eclipse.jdt.core

Eclipse Public License 2.0
164 stars 130 forks source link

The project was not built since its build path is incomplete. Cannot find the class file for java.lang.constant.DynamicConstantDesc #3023

Closed laeubi closed 1 month ago

laeubi commented 1 month ago

Today I changed some sources (no settings no JDK changes, project build successful before, nothing in the error log) on a project and get this error markers:

grafik

The Project is using java 17 grafik

This is very similar to

and really hurts user experience with using JDT/Eclipse:

  1. Obviously I can't "Fix the build path" as I have not changed anything there and all looks sane
  2. java.lang can not be added to the build path anyways
  3. cleaning multiple times does not change anything, so it seems something internally in JDT is wrecked

even though as last time it was claimed that the compiler can't do anything thing, I really think batch-compiler should somehow better handle such internal failures for synthetic jdk classes automatically injected, as a user I have zero influence nor any chance to find such a problem, e.g searching my whole codebase for java.lang.constant.DynamicConstantDesc or java.lang.constant.ConstantDesc will obviously not reveal any match, I can't "change" my JDK so if there is any problem with that I need guidance what is the problem. Most of the time one needs to restart eclipse and clean all projects to getting out of such situation see also for example:

jukzi commented 1 month ago

sounds like duplicate of https://github.com/eclipse-jdt/eclipse.jdt.core/issues/2877

laeubi commented 1 month ago

In this case I needed to restart + clean all projects to make the problem go away.

jukzi commented 1 month ago

then it is a duplicate of https://github.com/eclipse-jdt/eclipse.jdt.core/issues/2877