简体   繁体   English

缺少java.util.HashMap

[英]Missing java.util.HashMap

Is there any reason that I would be missing the java.util.HashMap package? 我有没有理由错过java.util.HashMap包? I have java.util.Hashtable, but no HashMap... 我有java.util.Hashtable,但没有HashMap ...

I have the most up to date JDK and JRE... 我有最新的JDK和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 ;) Blackberry Java确实有一个java.util.Hashtable但没有java.util.HashMap ...这将是你问题的完美匹配;)

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. 如果您想开发Blackberry应用程序,那么您必须使用'Blackberry Java',因为这是安装在移动设备上的Java。 Otherwise just install a fresh eclipse on your machine. 否则只需在你的机器上安装一个全新的日食。 You can have as many eclipse IDE's on your machine as you like. 你可以在你的机器上拥有尽可能多的eclipse IDE。 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. Blackberry对HashMap有不同的实现,它在net.rim.device.api.util.MultiMap下有一个名为multimap的类,类似于HashMap。

It can be used to do similar task as HashMap. 它可以用来执行与HashMap类似的任务。 The documenation can be found http://www.blackberry.com/developers/docs/4.3.0api/net/rim/device/api/util/MultiMap.html>here. 该文档可以在http://www.blackberry.com/developers/docs/4.3.0api/net/rim/device/api/util/MultiMap.html>其中找到。

Supported since API 4.3.0 自API 4.3.0起支持

BlackBerry devices use a subset of the Java API called J2ME . BlackBerry设备使用名为J2ME的Java API子集。 It does not have all of the features of the regular JDK, such as collections. 它没有常规JDK的所有功能,例如集合。

If you're using Eclipse, is the JDK in the classpath for the project itself? 如果您正在使用Eclipse,那么JDK是否在项目本身的类路径中? Although you're eclipse instance may be pointing to the JDK, it may not be available within the project's own classpath. 虽然你的eclipse实例可能指向JDK,但它可能在项目自己的类路径中不可用。

As well, are you using the standard JDK? 同样,您使用的是标准JDK吗? If you're using an implementation of the JDK that has a subset of the full JDK, that library may not be available. 如果您正在使用具有完整JDK子集的JDK实现,则该库可能不可用。

I have same problem when i install J2ME SDK 3. 我安装J2ME SDK 3时遇到同样的问题。

I open eclipse and get error what "Eclipse The import java.util cannot be resolved" 我打开eclipse并得到错误“Eclipse导入java.util无法解析”

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. 在Windows中我转到环境变量,发现var CLASSPATH的值为“.; C:\\ Program Files \\ Java \\ jre6 \\ lib \\ ext \\ QTJava.zip”对我来说,我只是删除了这个变量,eclipse项目开始工作正常,J2ME也是作品。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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