Eclipse 构建路径不可用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9086647/
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-10 20:53:30  来源:igfitidea点击:

Eclipse Build Path not available

eclipsebuildpath

提问by sammiwei

The build path option is not available when I right clicked on one of the the jars I wanted to include. Anybody knows why? Thanks! The Eclipse version I am using is
Eclipse SDK Version: 3.7.1 Build id: M20110909-1335
enter image description here

当我右键单击要包含的 jar 之一时,构建路径选项不可用。有谁知道为什么?谢谢!我使用的 Eclipse 版本是
Eclipse SDK 版本:3.7.1 构建 ID:M20110909-1335
在此处输入图片说明

回答by user8297907

  1. Right click on the Project and select properties. 2.Project facets --> java --> Apply
  1. 右键单击项目并选择属性。2.项目方面 --> java --> 应用

回答by Baldrick

Right click on the project, choose 'Properties'. In 'Java Build path', go to the 'Libraries' tab, and click on 'add JARs' to include jar of the workspace in the build path of your Java project.

右键单击项目,选择“属性”。在“Java 构建路径”中,转到“库”选项卡,然后单击“添加 JAR”以在 Java 项目的构建路径中包含工作区的 jar。

回答by Srini

Make sure u have all the below, 1) settings folder 2) .classpath 3) .project Just copy this and paste .project file, clean and build it,

确保您拥有以下所有内容,1) 设置文件夹 2) .classpath 3) .project 只需复制并粘贴 .project 文件,清理并构建它,

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>XXXX</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 Loy Alvares

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

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

This should fix the issue.

这应该可以解决问题。

回答by Ankit Mathur

Go To Your Project Workspace=>inside in Project root Folder.You will see .project file Open that and replace with it.

转到您的项目工作区 => 在项目根文件夹中。您将看到 .project 文件打开并替换为它。

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

回答by monkSinha

Don't know the reason. But this works for me, so posting it.

不知道原因。但这对我有用,所以发布它。

Right-click on the project -> 'Properties' -> 'Java Build Path'

右键单击项目 -> 'Properties' -> 'Java Build Path'

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

回答by mister270

If you are using an osgi run configuration, Run -> Run Configurations... Select you laucher and click on the Bundles tab. Filter with org.eclipse.swt and make sure that the org.eclipse.swt and org.eclipse.swt.[arch].[version].jar are checked.

如果您使用的是 osgi 运行配置,请运行 -> 运行配置...选择您的 laucher 并单击 Bundles 选项卡。用 org.eclipse.swt 过滤并确保 org.eclipse.swt 和 org.eclipse.swt.[arch].[version].jar 被选中。

This drove me nuts until I did this simple thing. If you validate bundles without having checked these you'll get a "No Problems" dialog but you'll get this error at run time

这让我发疯,直到我做了这个简单的事情。如果你在没有检查这些的情况下验证包,你会得到一个“没有问题”对话框,但你会在运行时收到这个错误