Reputation: 21
On Eclipse (OS X) when I create a SWT/JFace Java Project, then create an Application Window Java class file I cannot seem to resolve org.eclipse.swt imports. On the other hand, if I create a SWT/JFace Java Project and select "Use project folder as root for sources and class files" the import resolves and everything works fine. The imports also seem to resolve in the former case when I drag my .java file outside of the src folder and put it directly into the project folder, but in this case I don't have the option of selecting the 'Design' tab.
What should I do so that my org.eclipse.swt imports work inside the src folder?
Upvotes: 1
Views: 4334
Reputation: 34137
This sounds like SWT is missing on the Java Build Path.
Follow these instructions and downloaded the SWT binaries and sources from here.
If you move a .java
file outside the source folder (in your case src
), the Java editor icon will change form a normal J to an outline J indicating that the Java code is no longer being compiled: import statements do not have to be resolved and therefore are not displayed as errors.
Upvotes: 1