首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ant4eclipse类路径问题

ant4eclipse类路径问题
EN

Stack Overflow用户
提问于 2011-07-27 16:57:20
回答 1查看 1.9K关注 0票数 1

我的项目和ant4eclipse有问题。如果我运行build.xml,我会得到这样的消息:

代码语言:javascript
复制
Exception in thread "main" : org.ant4eclipse.lib.core.exception.Ant4EclipseException: Exception
whilst resolving the classpath entry '[EclipseClasspathEntry: path: 
org.eclipse.jst.j2ee.internal.module.container entryKind: 0 outputLocation: null exported: false]' of project 'MyProject': '

No 'jdtClassPathLibrary' defined for library entry 
'org.eclipse.jst.j2ee.internal.module.container'. 
To resolve this problem, please define a 'jdtClassPathLibrary' 
element inside your ant build file:

ant4eclipse:jdtClassPathLibrary name="org.eclipse.jst.j2ee.internal.module.container"  
fileset dir="..."/
/ant4eclipse:jdtClassPathLibrary 

但是我在哪里可以找到这些文件呢?.classpath文件只有以下条目:

代码语言:javascript
复制
classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-07-27 17:36:27

您的.classpath中包含的是一个容器条目。这是一种速记,意思是“包含这个容器中的所有jars”。jars组成容器的定义存储在工作区的.metadata目录中名为variablesAndContainers.dat的文件中(这些定义是工作区范围内的,而不是特定项目的范围)。

据我所知,ant4eclipse可以读取.classpath files,但不能读取variablesAndContainers.dat文件(几年前我上次使用ant4eclipse时确实如此)。这意味着,尽管它可以找到您在org.eclipse.jst.j2ee.internal.module.container容器中有一个类路径条目,但它无法找到该容器的定义是什么。

因此,无论何时使用容器,都必须以ant4eclipse:jdtClassPathLibrary元素的形式向ant4eclipse提供容器的定义,这与错误消息所说的完全相同:

代码语言:javascript
复制
<ant4eclipse:jdtClassPathLibrary name="org.eclipse.jst.j2ee.internal.module.container">
    <fileset dir="..."/>
</ant4eclipse:jdtClassPathLibrary>

fileset标记应该定义组成容器的jar文件。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6841771

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档