Adam Sh
Adam Sh

Reputation: 8577

Using using .jars in with Eclipse

I have a Java project called "ood_100" to which I am trying to add 2 jars (Xtream's jars).

What I did: right clicked on the project -> build path -> configure build path -> add external jars, and then I added 2 jars: xstream-1.4.2.jar and kxml2-min-2.3.0.jar.

Now, as I understand, I can the classes from the jar in my project. For example, XStream xstream = new XStream(); should work, but I am getting error: Xtream cannot be resovled to a type.

What could be the problem? Thanks

Upvotes: 2

Views: 847

Answers (2)

bmargulies
bmargulies

Reputation: 100023

If this is eclipse, use quick-fix to add an import for the class. If it isn't eclipse, please edit this question to tell us what is actually going on.

Upvotes: 0

adarshr
adarshr

Reputation: 62583

Have you imported the class com.thoughtworks.xstream.XStream?

import com.thoughtworks.xstream.XStream;

Upvotes: 7

Related Questions