Community
Participate
Working Groups
If a Java file contains classes beside the class that is named like the file name and these classes are not subclasses of this "main" class and the java file has not been opened in the editor the editor cannot resolve these classes. although the project compiles successfully. Example: a file Test.java contains two classes: class Test {} class Test2 {} Another file Main.java in the same package contains following: public class Main { Test2 test2 = new Test2(); } The editor marks a reference to Test2 from Main as error with the error message "Test2 cannot be resolved to a type" if and only if the file Test.java is not opened. Nevertheless the project compiles successfully.
The error annotation are coming form JDT/Core.
This is an issue with secondary types.
*** This bug has been marked as a duplicate of 36032 ***