Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unusual Compile Error

Status
Not open for further replies.

Terwin

Programmer
May 23, 2002
51
US
Wise Folks,

I have an unusual compile error with my servlet.

I import java.util.* to make use of the HashMap class. The compile error arises when I attempt to declare and instantiate a HashMap. The compiler reports that it cannot find (mypackagename).HashMap. I'm unsure as to why it's looking for the HashMap class in my package rather than finding it in java.util where it lives.

When I attempt to import directly java.util.HashMap the compiler returns an error with the import.

I'm assuming this is a path issue. If so, I'd greatly appreciate any suggestions as to how I might go about investigating and/or fixing it.

Thanks,
Terwin
 
is the java.util jar in the classpath?

(make sure the jar is in the cp, not just the directory where the jar resides)
 
Aha.

classes.zip, which comes with CodeWarrior is evidently a holdover from older java versions (1.1). The blackest of curses upon classes.zip, which was now scrapped in favor of rt.jar, which does support the HashMap class.

Thanks,
Terwin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top