I am trying to write a small program that requires the import statement import org.eclipse.swt.*;
. (I'm practicing with THIS tutorial).
However, Eclipse won't compile the program and is giving me the error "The import org.eclipse cannot be resolved
"
Google hasn't been such a a great friend at finding the answer this time.
Create a Maven project and add
org.eclipse.swt
dependency inpom.xml
:You can find the 64bit version of the SWT library by changing the download url to this: http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/R-4.3-201306052000/swt-4.3-win32-win32-x86_64.zip
I followed the instructions here and got my problem solved http://www.mkyong.com/swt/how-to-import-swt-library-into-eclipse-workspace/
This is because you haven't added the SWT library to your buildpath. Follow the steps of the tutorial: