从CVS中下载的源码导入到eclipse时会发现快捷键都不能用了
2012-05-24 14:52
826 查看
最近进了一家公司,主要是做Pos机的,从CVS上下载源码import入eclipse时:
发现按F3快捷键的时候,会弹出一个信息:problems opening editor. Reason : the project tms2 does not exist !
当按F4快捷键的时候,会弹出这样的信息:the resource is not on the build path of a java project.
同时ctrl + shift + t 和别的快捷键都不能使用,我们甚至连build path选项也找不到。
这是因为我们从CVS上下载源码导入到我们本地的eclipse中时,项目的路径其实是虚拟的,因此解决办法是配置:.project 文件
下面是我针对自己项目做的配置!(注:该项目用的是java三大框架)
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tms2</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.ibm.etools.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.ibm.sse.model.structuredbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.hibernate.HibernateBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.core.springbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.beans.core.beansvalidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.genuitec.eclipse.ast.deploy.core.deploymentnature</nature>
<nature>org.springframework.ide.eclipse.beans.core.beansnature</nature>
<nature>org.springframework.ide.eclipse.core.springnature</nature>
<nature>com.genuitec.eclipse.hibernate.hibernatenature</nature>
<nature>com.genuitec.eclipse.j2eedt.core.webnature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>com.genuitec.eclipse.cross.easystruts.eclipse.easystrutsnature</nature>
</natures>
</projectDescription>
当我们配置完成后,改项目可以被成功编译了,但是可能依然会报一个错误:The
type java.lang.Object
cannot be
resolved. It
is indirectly
referenced from required .class files
当你在Eclipse引用不同版本JDK工程时会发生该问题。由于你开发环境中应用了多个版本的JDK 或JRE导致的。Eclipse会按照最初的开发环境默认选择对应的Jre。如Eclipse上有jdk1.4开发的环境工程,当你在引入高版本jdk1.6开发的工程时,以上问题就出现了。
针对这种情况的解决办法是:
进入window\preferences\java\Installed JREs
按Add --> Browse...--->选择jre安装路劲(我的jre路径是D:\Program Files\Java\jre1.6.0_02)--->OK
找到你的工程右键点击Properties选项 出现对话框后 选择右边的Libraries选项卡 ---> 单击Add 了Library...--->
选择Jre System Library... ---> Next--->选择Alternate Jre 下的对应版本jre --> Finish ---> Ok
以上问题就可解决。
发现按F3快捷键的时候,会弹出一个信息:problems opening editor. Reason : the project tms2 does not exist !
当按F4快捷键的时候,会弹出这样的信息:the resource is not on the build path of a java project.
同时ctrl + shift + t 和别的快捷键都不能使用,我们甚至连build path选项也找不到。
这是因为我们从CVS上下载源码导入到我们本地的eclipse中时,项目的路径其实是虚拟的,因此解决办法是配置:.project 文件
下面是我针对自己项目做的配置!(注:该项目用的是java三大框架)
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tms2</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.ibm.etools.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.ibm.sse.model.structuredbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.hibernate.HibernateBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.core.springbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.beans.core.beansvalidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.genuitec.eclipse.ast.deploy.core.deploymentnature</nature>
<nature>org.springframework.ide.eclipse.beans.core.beansnature</nature>
<nature>org.springframework.ide.eclipse.core.springnature</nature>
<nature>com.genuitec.eclipse.hibernate.hibernatenature</nature>
<nature>com.genuitec.eclipse.j2eedt.core.webnature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>com.genuitec.eclipse.cross.easystruts.eclipse.easystrutsnature</nature>
</natures>
</projectDescription>
当我们配置完成后,改项目可以被成功编译了,但是可能依然会报一个错误:The
type java.lang.Object
cannot be
resolved. It
is indirectly
referenced from required .class files
当你在Eclipse引用不同版本JDK工程时会发生该问题。由于你开发环境中应用了多个版本的JDK 或JRE导致的。Eclipse会按照最初的开发环境默认选择对应的Jre。如Eclipse上有jdk1.4开发的环境工程,当你在引入高版本jdk1.6开发的工程时,以上问题就出现了。
针对这种情况的解决办法是:
进入window\preferences\java\Installed JREs
按Add --> Browse...--->选择jre安装路劲(我的jre路径是D:\Program Files\Java\jre1.6.0_02)--->OK
找到你的工程右键点击Properties选项 出现对话框后 选择右边的Libraries选项卡 ---> 单击Add 了Library...--->
选择Jre System Library... ---> Next--->选择Alternate Jre 下的对应版本jre --> Finish ---> Ok
以上问题就可解决。
相关文章推荐
- spring-framework3.2源码下载导入eclipse
- javaEE版本的eclipse中导入工程,发现server里面找不到工程,根本发布不了也不能运行
- spring-framework 4.x 源码下载并导入eclipse
- 用SVN下载编译Spring v4.1.6.RELEASE源码导入eclipse
- Tomcat源码解析(一)下载源码与导入eclipse
- spring framework源码下载并导入eclipse
- spring framework源码下载并导入eclipse
- tomcat源码下载并导入eclipse
- 用SVN下载编译Spring v4.1.6.RELEASE源码导入eclipse
- spring framework源码下载并导入eclipse
- spring framework源码下载并导入eclipse
- 用SVN下载编译Spring3.2.4源码导入eclipse
- spring framework源码下载并导入eclipse
- Hadoop 源码下载,编译,install,导入eclipse
- 网上源码导入eclipse不能作为工程导入的解决办法
- Android源码批量下载及导入到Eclipse
- 【10% free time】Tomcat学习之一:下载源码,导入eclipse
- 下载Tomcat源码,并作为工程导入到Eclipse中
- tomcat源码下载并导入eclipse
- 如何把下载的Android源码文件夹直接批量导入Eclipse