No color highlight in Eclipse in some files

In a workspace with several projects, I see correctly all the text markup in all files except one, where there is only the markup for specifiers, types and strings.

What I have already tried:

  • Check if the file is opened with the text editor instead of the Java editor. It's not. The file is opened with the Java Editor.
  • Restart Eclipse.
  • Clean the project.

The problem persists.

The problem: enter image description here

What I expect: enter image description here

Any help will be highly appreciated and voted.


Solution 1:

The Error Log view shows that you use a JRE from Eclipse JustJ to run your Eclipse.

The problem is that you have a minimal instead of a complete JDK installed.

Alternatively, you can specify the Java 11 or higher VM in the eclipse.ini to run Eclipse.

The JustJ OpenJDK Hotspot JRE Minimal (Stripped) is sufficient to run the Eclipse Installer and the Eclipse platform, but not to run the Eclipse Java IDE you have without errors.

Minimal means that only those system library modules are included that are required by the Eclipse platform and Complete means the full system library.