在   eclipse3.2   +   tomcat5.0   +   jdk1.5   编译下面程序不能通过 private   Map <String,   String>   lzwParameter   =   new   HashMap <String,   String> (); 提示错误为:The   type   Map   is   not   generic;   it   cannot   be   parameterized   with   arguments   <String,   String> 请大家帮忙!急!!!!!!!!!!!!!!

解决方案 »

  1.   

    你要把 Eclipse 的编译级别设为 5.0:Window --> Preferences... --> Java --> Compiler,将 Compiler Compliance Level 设为 5.0 再试试看。
      

  2.   

      Map   <String,       String>       lzwParameter       =       new       HashMap   <String,       String>   ();这个map的引用路径是什么?是java.lang.util么?
      

  3.   

    确认一下Map和HashMap是不是都为java.util包下的
    看import部分对不对,然后将eclipse编译级别设为5.0,如2楼所说
      

  4.   

    把两边的<String,       String>去掉,就好了,我也遇到过,不会影响什么的
      

  5.   

    是不是eclipse中选的jdk不是5.0啊
    还有就是map的包是不是导错了,
    其它情况没遇到过
      

  6.   

    用的肯定不是1。5  The       type       Map       is       not       generic;       it       cannot       be       parameterized       with       arguments       <String,       String> 
      

  7.   

    这是个范型的问题,只有jdk1.5有,你用的jdk不是1.5的,请仔细看一下。