Q:

Hashmap in Hadoop

I would like to use the hashmap class defined in java.util.* in hadoop program.
A hashmap in Java is instantiated using Map D = new HashMap();
When you use the above line and compile with hadoop jar , it throws an error as Map is used for something different in hadoop.
On searching for hadoop equivalent of hashmap , I stumbled on HashMapWritable
http://lintool.github.io/Cloud9/docs/api/edu/umd/cloud9/io/map/HashMapWritable.html 
One example program where HashMapWritable is used looks like this :
http://trac.nchc.org.tw/cloud/browser/sample/hadoop-0.16/tw/org/nchc/tuple/HashMapWritable.java
I don't want to go through the pain of creating a separate class and defining separate objects for keys and values.
Is there a simpler way , I can implement this in a single line like we do in Java ( I mean in a simple way like hashmap(key , value) H = new hashmap() )

A:

You can try:
java.util.Map<K,V> map= new HashMap<K,V>();

that way it will resolve to the Map class that you want.

