|import org.eclipse.swt.*; not resolved [message #946591]
||Tue, 16 October 2012 06:16
| Peter King
Registered: September 2012
I seem to be going round in circles here.|
I had a series of related projects that were working, and something has caused it not to work. The symptoms are that any source file using an import from an org.eclipse.swt bundle will not compile, with the red line being under the import statement(s).
Some of the projects have a plugin dependency on org.eclipse.swt jar, but others don't. If I try to add such a dependency, org.eclipse.swt isn't offered as a bundle, but only the platform dependent bundles such as org.eclipse.win32.win32.x86 can be added from the dependencies tab in the Manifest editor.
The build path accessed through right clicking on the source file in the Package Explorer shows the dependency too.
If I explicitly add the org.eclipse.win32.win32.x86 jar to the build path, most of the projects will build, but a couple still have errors ( the offending line in these is
SWTApplicationComposite window = new SWTApplicationComposite(parent);
and the obcection is to parent - as an unrecognised class Composite although it has been declared without a problem!)
I have tried deleting the dependency and then adding it as a new dependency, but the compiler still fails to find it.
Any clues as to what I might have missed (I'm doing this as part of an RCP development)
Thanks in advance for any help.
[Updated on: Tue, 16 October 2012 18:12]
Report message to a moderator
|Re: import org.eclipse.swt.*; not resolved [message #951577 is a reply to message #946591]
||Sat, 20 October 2012 17:25
| Stephan Herrmann
Registered: July 2009
Not being able to add an swt dependency looks wrong, unless this dependency is already there.|
Places to look for information:
- Package Explorer: open node Plug-in Dependencies
- Manifest editor, tab Dependencies, open Dependency Analysis
- are all SWT classes unresolved in the affected projects?
You could also try to manually copy the dependency from a good MANIFEST.MF to a broken one.
The code snippet you showed doesn't give enough context to see what the compiler complains about and why it shouldn't.
Not sure what's going on,
Powered by FUDForum
. Page generated in 0.02036 seconds