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

本文档详细介绍了如何在 Eclipse 中正确配置 SWT (Standard Widget Toolkit) 插件,包括导入 SWT 插件、设置构建路径、解决重复条目问题等步骤。通过这些步骤,用户可以成功地在 Eclipse 开发环境中使用 SWT 进行 Java GUI 应用程序开发。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值