将 Eclipse 项目类型从通用转换为 Java [英] Convert Eclipse project type from general to Java

查看:62
本文介绍了将 Eclipse 项目类型从通用转换为 Java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在接管另一个团队的项目,但遇到了一些奇怪的 Eclipse 问题.

I'm taking over another team's project and am experiencing some bizarre Eclipse issues.

我使用 Subversive 作为我的插件,当我去检查后备箱时,它会带我进入一个标准的Check Out As"对话框,它允许我选择检查方法,这是唯一有效的方法对我来说(或适用)是最后一个选项(作为指定名称的项目签出).

I'm using Subversive as my plugin, and when I go to check the trunk out it brings me to a standard "Check Out As" dialog where it allows me to select the check out method, and the only one that works for me (or is applicable) is the last option (Check out as a project with the name specified).

所以我指定了名称,然后项目正常检查,一切都很好,除了...

So I specify the name, and the project then checks out as normal and all is well, except...

虽然这应该是一个 Java 项目(WAR 变成一个 Java 网络应用程序),但似乎制作该项目的团队将其创建为一个通用的项目(通过转到 Project > Properties > Resource > Type = 'Project').

Although this is supposed to be a Java project (WARs up into a Java web app), it seems that the team that made the project created it as a general project (by going to Project > Properties > Resource > Type = 'Project').

因此,Java 项目附带的所有典型功能均未启用,包括(但当然不限于):

As such, none of the typical features that come with a Java project are enabled, including (but certainly not limited to):

  • F3 不起作用,即使该类型定义在与我当前正在编辑的类型相同的包(在本例中为文件夹)中(因为 Eclipse 不会将此视为Java项目)
  • 无法搜索 Java 类
  • 无法从 Eclipse 内部构建(因为没有源包,只有文件夹)等.
  • 这个列表不胜枚举......
  • F3 doesn't work, even if the type is defined inside the same package (folder in this case) as the type I'm currently editing (because Eclipse isn't treating this like a Java project)
  • Can't search for Java classes
  • Can't build from inside Eclipse (because there are not source packages, only folders), etc.
  • This list goes on and on...

所以我的问题是:

  • 有没有办法将这种一般项目类型转换为Java项目,而无需创建一个全新的项目并复制所有内容?
  • 我想知道我是否错误地检出项目,但没有一个检出方法(在 Subversive 中)真正适用:(1) 检出作为使用新建项目向导配置的项目(为什么要签出新项目?!?),(2)在所选资源的子项中查找项目(否),(3)作为文件夹签出到现有项目(否).
  • 我可以通过其他途径来Java 化"这个项目吗?
  • Is there a way to convert this General Project type into a Java Project without having to make a whole new project and copying everything over?
  • I'm wondering if I checked the project out incorrectly, but none of the checkout methods (in Subversive) were really applicable: (1) Check out as a project configured using the New Project Wizard (why check out as a new project?!?), (2) Find projects in the children of the selected resource (no), (3) Check out as a folder into an existing project (no).
  • Is there any other avenue I could take here to "Java-ify" this project?

推荐答案

Project Properties -> Project Facets -> Convert to faceted form... 下可以选择Java - 这会将 Java 功能添加到您的项目中.如有必要,您还可以在那里添加其他方面,例如 Dynamic Web Module.

Under Project Properties -> Project Facets -> Convert to faceted form... you can select Java - this will add the Java functionalities to your project. There you can also add other facets like Dynamic Web Module if necessary.

根据您编写的内容,该项目已正确检出.当存储库中不存在 .project 文件并且您必须手动选择项目类型时,选项 Check out as a project configure using the New Project Wizard 适用.它只会在本地创建一个新的 Eclipse 项目.

From what you have written the project was checked out correctly. The option Check out as a project configured using the New Project Wizard is applicable when the .project file does not exist in the repository and you have to select the project type manually. It will only create a new Eclipse project locally.

这篇关于将 Eclipse 项目类型从通用转换为 Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆