使用myeclipse自动导入hibernate3的jar包,如何关联hibernate源码的解决办法

时间:2023-03-09 16:43:38
使用myeclipse自动导入hibernate3的jar包,如何关联hibernate源码的解决办法

1.在网上找了好久,今天终于解决了,如果你的myeclipse自动生成的添加hibernate3jar包时,依靠通常的方法是无法关联其相应版本的源代码的,就是你在编写代码是,按住ctrl + hibernate类名查看源码,选择Attach Source ,选择你解压的源码目录,当你点击OK时,没有任何反应,这是因为使用myeclipse自动添加的jar包时,只能使用下面这种方法来关联:   如下图所示:选择myeclipse菜单项选择 myeclipse-->Preference->Myeclipse->project Capabilities->hibernate , 此时选择相应的hibernate版本添加,例如我的是hibernate3.3如下图所示:

使用myeclipse自动导入hibernate3的jar包,如何关联hibernate源码的解决办法

2.将Library Modules选择成(默认不是该模式):  Hibernate 3.3 core Libraries模式,找到hibernate3.jar,展开选项,选择 Source attachment 选项双击,弹出如下图

使用myeclipse自动导入hibernate3的jar包,如何关联hibernate源码的解决办法

选择你要关联的hibernate源码,zip或者文件夹都可以,我的是解压的文件夹形式的,至此就可以啦!