简体   繁体   English

将 Java 构建器添加到 Eclipse 中的 .project 文件

[英]Adding Java builder to .project file in Eclipse

I need to add a Java builder to mt .project file in Eclipse.我需要在 Eclipse 中向 mt .project 文件添加一个 Java 构建器。 However, there is no such file in my project folder.但是,我的项目文件夹中没有这样的文件。 I don't know where this file is, maybe you can help me out?我不知道这个文件在哪里,也许你能帮帮我?

In Eclipse, the .project file is kept in the root directory of your project, which is in your workspace.在 Eclipse 中,.project 文件保存在项目的根目录中,该目录位于您的工作区中。 It's easy to see if you do a directory listing in your underlying filesystem.很容易看出您是否在底层文件系统中列出了目录。 If you want to find out where your workspace is, find it by looking at the project in the Package Explorer.如果您想找出您的工作区在哪里,请通过查看包资源管理器中的项目来找到它。 right-click > Properties > Resource > Location.右键单击 > 属性 > 资源 > 位置。

It might be better to use Eclipse itself to add a builder to your project, for example, using the Package Explorer - project right-click > Properties > Builders feature.使用 Eclipse 本身向项目添加构建器可能会更好,例如,使用包资源管理器 - 项目右键单击 > 属性 > 构建器功能。

Convert the project into a faceted project.将项目转换为分面项目。 This generally happens when you import a project from git and the project is not a java project.当您从 git 导入项目并且该项目不是 java 项目时,通常会发生这种情况。

Steps:脚步:

  1. Right Click -> Properties -> Project Facets右键单击 -> 属性 -> 项目构面
  2. Click on convert project into a faceted project单击将项目转换为分面项目
  3. Select the builder as java builder.选择构建器作为 java 构建器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM