Eclipse plugin dependency on SWT classes not resolved

I have an eclipse plugin project that uses some swt objects, for example -

import org.eclipse.swt.widgets.Composite;

When I try to compile it with the "Target Platform" set to "Running Platform (Active)", it compiles fine, and I do not need to import any swt-specific plugins.

However, I created the target platform with Eclipse 3.6.0, and if I installed it as an active platform, the project compiles errors wherever the swt classes are used, and cannot resolve them.

Which plugin should I add a dependency to fix these errors?

I tried adding 'org.eclipse.swt', but that doesn't seem to help.

+5
source share
3 answers

I get it. I tried to compile a 32-bit target platform on a 64-bit OS, so the filters did not match the SWT libraries until I manually installed them from the settings of the target platform.

+4
source

I had the same problem. In my case, I had a missing dependency and I asked Eclipse to find a plugin for me.

After the plugin was found on some site p2, I saw “Reset Target Platform” in the progress view.

After that, many plugins were broken. Checking the target platform (Window → Settings → Plugin Development → Target Platform → Change), the "Architecture" field has changed from x86_64to x86.

"" reset TP , .

+9

For me, I needed to add external jars corresponding to SWT libraries to my build path. In addition, I needed to add those related to my platform (Windows).

I added the following jars to the project build path:

$USER/.p2/pool/plugins/org.eclipse.swt_3.106.1.v20170926-0519.jar
$USER/.p2/pool/plugins/org.eclipse.swt_3.106.1.v20170926-0519.jar
-1
source

All Articles