Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » import org.eclipse.swt.*; not resolved(Compiler not resolving imports, despite plugin being in dependencies)
import org.eclipse.swt.*; not resolved [message #946591] Tue, 16 October 2012 10:16 Go to next message
Peter King is currently offline Peter KingFriend
Messages: 3
Registered: September 2012
Junior Member
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.

Peter

[Updated on: Tue, 16 October 2012 22: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 21:25 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
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,
Stephan
Previous Topic:Java Field Assist
Next Topic:getting the path of the currently working directory
Goto Forum:
  


Current Time: Sat Nov 09 01:19:18 GMT 2024

Powered by FUDForum. Page generated in 0.02825 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top