将多个jar包含在classpathentry中 [英] Include multiple jars with classpathentry
本文介绍了将多个jar包含在classpathentry中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<?xml version =1.0encoding = UTF-8 >?;
< classpath>
< classpathentry kind =srcpath =src/>
< classpathentry kind =srcpath =test/>
< classpathentry kind =conpath =org.eclipse.jdt.launching.JRE_CONTAINER/>
< classpathentry kind =outputpath =bin/>
< classpathentry kind =libpath =/ libraries / jee / servlet-api.jar/>
< classpathentry kind =libpath =/ libraries / junit / junit-4.6.jar/>
< classpathentry kind =libpath =/ libraries / log4j / log4j-1.2.15.jar/>
< / classpath>
我想添加一个完整的jar目录到类路径 - 我喜欢eclipse(或更多准确地说,我们使用.classpath格式的基于ant的构建过程)来了解驻留在单个目录中的几个jar,而不直接指定它们。我怎么能这样做?
解决方案
我不确定eclipse可以做到这一点。
您可以尝试
- 移动到Maven为您构建系统,然后是eclipse:eclipse命令将生成。 classpath文件为您
- 在构建之后,让ant修改.classpath。毕竟,它只是xml
I have an eclipse's .classpath file that looks like this:
<?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>
I'd like to add a whole directory of jars to the classpath - I like eclipse (or more precisely, our ant-based build process that uses .classpath format) to know several jars that reside in a single directory, without specifying them directly. How can I do that?
解决方案
I'm not sure eclipse can do that itself.
You could try
- Move to Maven for you build system and then it's eclipse:eclipse command will generate the .classpath file for you
- Get ant to modify the .classpath after a build. After all, it's just xml
这篇关于将多个jar包含在classpathentry中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文