使用右键单击项目时,如何在 Eclipse 中添加“构建路径”选项?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6624330/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 16:34:09  来源:igfitidea点击:

How to add "Build path" option in Eclipse, when clicking on a project with right button?

eclipse

提问by Pawe? Czech

As in a topic. I can not find solution, how to add that option to right button list.

就像在一个主题中一样。我找不到解决方案,如何将该选项添加到右键列表中。

回答by Loy Alvares

In the Toolbar Menu, click on "Window->Show View->Package Explorer.

在工具栏菜单中,单击“窗口->显示视图->包资源管理器”。

This should fix the issue.

这应该可以解决问题。

回答by Utku

It was a problem of mine too. Have you tried:

这也是我的一个问题。你有没有尝试过:

  1. Right click on the project's name.
  2. Click Properties.
  3. Click Java Build Path that appear on the menu to the left.
  4. From the buttons that appear on the right, click Add External JARs.
  5. From the window that appears, find the jar file(s) that you want to add and then click open. It should be done now.
  1. 右键单击项目名称。
  2. 单击属性。
  3. 单击左侧菜单上显示的 Java Build Path。
  4. 从右侧出现的按钮中,单击添加外部 JAR。
  5. 从出现的窗口中,找到要添加的 jar 文件,然后单击打开。现在应该做。

回答by ifx

You need to ensure that your project (.project file in your project's root directory) includes the Java Nature and build spec, for example:

您需要确保您的项目(项目根目录中的 .project 文件)包含 Java Nature 和构建规范,例如:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>project_1_x</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
        <buildCommand>
            <name>org.eclipse.jdt.core.javabuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>org.eclipse.jdt.core.javanature</nature>
    </natures>
</projectDescription>

回答by ArunM

Right click on the project -> Search Project Facets -> Convert to faceted project -> Enable the builder (ex. Java)

右键单击项目 -> Search Project Facets -> Convert to faceted project -> Enable the builder (ex. Java)