views:

168

answers:

1

Hello,

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?

A: 

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.

jmcmahon