基本 XStream 注释
我刚刚开始使用 XStream Annotations,并且试图弄清楚如何将注释与 XStream 对象关联起来。从文档来看,这似乎是可接受的方法:
XStream xstream = new XStream(new DomDriver());
xstream.processAnnotations(AnnotatedClass.class);
我的问题是 Eclipse 没有将其识别为有效方法。 Eclipse 中的所有内容似乎都已正确配置,因为它向我显示了 XStream 对象中的其余方法。这几乎就像 Eclipse 认为它是 xstream 的旧版本。
我尝试过运行一个项目>清理 Eclipse 内部但这并没有解决任何问题。我还尝试再次下载 XStream jar,但这也没有帮助。
版本:XStream 1.3.1、Eclipse 3.4、Java 6
有人以前见过这种奇怪的行为,或者对如何修复它有任何想法吗?
I just started using XStream Annotations, and I am trying to figure out how to associate the annotations with the XStream object. From the documentation, it seems like this is the accepted method:
XStream xstream = new XStream(new DomDriver());
xstream.processAnnotations(AnnotatedClass.class);
My problem with this is that Eclipse isn't recognizing this as a valid method. Everything seems to be configured correctly in Eclipse because it shows me the rest of the methods that are in the XStream object. It's almost like Eclipse thinks it's an older version of xstream.
I've tried running a Project > Clean inside of Eclipse but that didn't fix anything. I've also tried downloading the XStream jar again which didn't help either.
Versions: XStream 1.3.1, Eclipse 3.4, Java 6
Has anybody seen this strange behavior before, or have any ideas on how to fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的类路径上的其他 jars 之一正在使用旧版本的 XStream。
要解决该问题:项目属性> Java 构建路径 >订购和导出
从那里只需将 jar 移至列表顶部,Eclipse 就会选择该 jar 的正确版本。
One of the other jars on my classpath was using an older version of XStream.
To fix the problem: Project Properties > Java Build Path > Order and Export
From there just move the jar to the top of the list and Eclipse picks up the correct version of the jar.