简体   繁体   中英

Missing java.util.HashMap

Is there any reason that I would be missing the java.util.HashMap package? I have java.util.Hashtable, but no HashMap...

I have the most up to date JDK and JRE...

Thanks!

Wow - that's weird! Could it be that your working on a mobile app like development for a Blackberry? The Blackberry Java does have a java.util.Hashtable but no java.util.HashMap ... This would be a perfect match for your problem ;)

Edit

If you want to develop Blackberry applications, then you have to use the 'Blackberry Java', because that is the Java that is installed on the mobile. Otherwise just install a fresh eclipse on your machine. You can have as many eclipse IDE's on your machine as you like. They do not interfere.

Blackberry has a different implementation for HashMap , it has a class called multimap under net.rim.device.api.util.MultiMap which is similar to HashMap.

It can be used to do similar task as HashMap. The documenation can be found http://www.blackberry.com/developers/docs/4.3.0api/net/rim/device/api/util/MultiMap.html>here.

Supported since API 4.3.0

BlackBerry devices use a subset of the Java API called J2ME . It does not have all of the features of the regular JDK, such as collections.

If you're using Eclipse, is the JDK in the classpath for the project itself? Although you're eclipse instance may be pointing to the JDK, it may not be available within the project's own classpath.

As well, are you using the standard JDK? If you're using an implementation of the JDK that has a subset of the full JDK, that library may not be available.

I have same problem when i install J2ME SDK 3.

I open eclipse and get error what "Eclipse The import java.util cannot be resolved"

In windows i goto environment variables and found there var CLASSPATH with value ".;C:\\Program Files\\Java\\jre6\\lib\\ext\\QTJava.zip" for me i just delete this variable and eclipse projects start work fine and J2ME also works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM