我有一个 eclipse 的 .classpath 文件,看起来像这样:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="lib" path="/libraries/jee/servlet-api.jar"/>
<classpathentry kind="lib" path="/libraries/junit/junit-4.6.jar"/>
<classpathentry kind="lib" path="/libraries/log4j/log4j-1.2.15.jar"/>
</classpath>
我想将整个 jar 目录添加到类路径中 - 我喜欢 eclipse(或者更准确地说,我们使用 .classpath 格式的基于 ant 的构建过程)知道位于单个目录中的多个 jar,而无需直接指定它们。我该怎么做?
最佳答案
我不确定 eclipse 自己能做到这一点。
你可以试试
- 移动到 Maven 为您构建系统,然后它的 eclipse:eclipse 命令将为您生成 .classpath 文件
- 让 ant 在构建后修改 .classpath。毕竟,它只是 xml
关于java - 使用 classpathentry 包含多个 jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1073693/