当我右键单击我想要包含的其中一个jar文件时,构建路径选项不可用。有人知道原因吗?谢谢!我使用的Eclipse版本是
Eclipse SDK 版本:3.7.1 构建ID:M20110909-1335
Eclipse SDK 版本:3.7.1 构建ID:M20110909-1335
<?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>
右键单击项目,选择“属性”。在“Java构建路径”中,转到“库”选项卡,并单击“添加JAR文件”以将工作区的jar包包含在Java项目的构建路径中。
前往您的项目工作区 => 在项目根文件夹内。您将看到 .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>