[转载]MyEclipse插件菜单 add hibernate capabilities 不可用的解决办法

用myEclipse搭建hibernate框架后,有时搞乱了某些东西后,又想重新加载Hibernate包,但此时 add hibernate capabilities 功能菜单竟然是灰色的,不可用,尤其是初学的朋友往往要重建web项目,一切都要重新来过。

其实大可不必这么做。有个简单的方法可以解决这个问题:

切换到java的导航试图,在项目的根目录下又个项目配置文件:".project",打开后如下代码所示。

  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <projectDescription>  
  3.     <name>CourseMS</name>  
  4.     <comment></comment>  
  5.     <projects>  
  6.     </projects>  
  7.     <buildSpec>  
  8.         <buildCommand>  
  9.             <name>com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder</name>  
  10.             <arguments>  
  11.             </arguments>  
  12.         </buildCommand>  
  13.         <buildCommand>  
  14.             <name>org.eclipse.jdt.core.javabuilder</name>  
  15.             <arguments>  
  16.             </arguments>  
  17.         </buildCommand>  
  18.         <buildCommand>  
  19.             <name>com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator</name>  
  20.             <arguments>  
  21.             </arguments>  
  22.         </buildCommand>  
  23.         <buildCommand>  
  24.             <name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator</name>  
  25.             <arguments>  
  26.             </arguments>  
  27.         </buildCommand>  
  28.         <buildCommand>  
  29.             <name>org.eclipse.wst.validation.validationbuilder</name>  
  30.             <arguments>  
  31.             </arguments>  
  32.         </buildCommand>  
  33.         <buildCommand>  
  34.             <name>com.genuitec.eclipse.hibernate.HibernateBuilder</name>  
  35.             <arguments>  
  36.             </arguments>  
  37.         </buildCommand>  
  38.     </buildSpec>  
  39.     <natures>  
  40.         <nature>com.genuitec.eclipse.hibernate.hibernatenature</nature>  
  41.         <nature>com.genuitec.eclipse.j2eedt.core.webnature</nature>  
  42.         <nature>org.eclipse.jdt.core.javanature</nature>  
  43.         <nature>org.eclipse.wst.jsdt.core.jsNature</nature>  
  44.     </natures>  
  45. </projectDescription>  
 

一般在最下方有:

 

  1. <buildCommand>  
  2.             <name>com.genuitec.eclipse.hibernate.HibernateBuilder</name>  
  3.             <arguments>  
  4.             </arguments>  
  5.         </buildCommand>  
 

  1. <nature>com.genuitec.eclipse.hibernate.hibernatenature</nature>  
 

将这两段删除即可

 

 






本文转自xwdreamer博客园博客,原文链接:http://www.cnblogs.com/xwdreamer/archive/2010/11/22/2297072.html,如需转载请自行联系原作者





上一篇:Java高级——缓存的使用场景


下一篇:如何防止通过IP地址访问Tomcat管理页面