eclipse有关调试问题的解决The source attachment does not contain the source for the file

On Wed, 20 Dec 2006 08:21:16 +0100, Daniel Megert wrote:
I followed your instructions... feedback below.

> Since you have the Eclipse SDK downloaded let's do it the easy way:
> 1. start your workspace
> 2. File > Import... > Plug-ins and Fragments
> 3. click 'Next'
> 4. verify that the top most checkbox is checked and that the location
> points to your Eclipse installation

It did. No problems so far.

> if not: got to the PDE Target preference page and reset the settings
> 5. select 'Binary project'
> 6. click 'Next'
> 7. on the left side select org.eclipse.swt
> 8. click 'Add'
> 9. click 'Required Plug-ins'
> 10. click 'Finish'
> 11. now check that these steps worked:
> use Ctrl+Shift+T to open an SWT type (e.g. Display) and verify
> that source is shown in the editor

This does not work. If I highlight Display, I get:

The source attachment does not contain the source for the file
Display.class. You can change the source attachment by clicking Change
Attached Source below.

> 12. open your Java project's build path property page

Project->Properties-> Java Build Path

> 13. make sure there is NO swt.jar under 'Libraries'

SWT is there and under it is org.eclipse.swt.gtk.linux.x86. And under
Native library location it has.../workspace/org.eclipse.swt.gtk.linux.x86/
- non modifiable.

> 14. on the 'Projects' tab add all the org.eclipse.swt* projects that you
> imported under step 10.

"Build path contains duplicate entry: 'org.eclipse.swt.gtk.linux.x86' for
project test" So I removed it here.

> 15. click 'OK'
> You should now be setup correctly. In the future if you need to switch
> to a new SWT version simply install the new version and repeat steps 1 -10.

It works now.

FWIW, I have never had to manually add anything to do with SWT to my
projects before.

Thanks for your help.
想对作者说点什么? 我来说一句