当我右键单击我想要包含的其中一个罐子时,构建路径选项不可用。谁知道为什么?谢谢!我正在使用的Eclipse版本是
Eclipse SDK
版本:3.7.1
构建ID:M20110909-1335
答案 0 :(得分:8)
答案 1 :(得分:6)
右键单击项目,选择“属性”。在“Java Build path”中,转到“Libraries”选项卡,然后单击“add JARs”以在Java项目的构建路径中包含jar工作区。
答案 2 :(得分:5)
确保你拥有以下所有, 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>
答案 3 :(得分:2)
在工具栏菜单中,点击“Window-&gt; Show View-&gt; Package Explorer。
这应解决问题。
答案 4 :(得分:0)
转到项目工作区=&gt;在项目根文件夹中。您将看到.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>
答案 5 :(得分:0)
答案 6 :(得分:-1)
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.
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