Azi*_*uth 0 java nosuchmethoderror
我正在尝试使用TreeMap类的ceilingKey(),ceilingEntry(),firstKey()和firstEntry()但收到错误:
java.lang.NoSuchMethodError: method java.util.TreeMap.firstEntry with signature ()Ljava.util.Map$Entry; was not found.
此错误是由以下代码引起的:
if (tmpmap.size() == 1 && tmpmap.firstKey() == req_sbyte && tmpmap.firstEntry().getValue() == req_size) {
send("F" + req_nr + "," + Integer.toString(req_filenr) + "," + Long.toString(req_sbyte) + "," + Integer.toString(req_size), "localhost", CLIENTPORT);
}
这是java -version的输出:
java version "1.5.0"
gij (GNU libgcj) version 4.1.2 20070925 (Red Hat 4.1.2-33)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
任何解释为什么会发生这种情况以及如何解决它?我检查了libgcj的文档,它说有这样的方法firstEntry(),它返回具有getValue()方法的Entry对象.所以我不清楚我的代码有什么问题.
firstEntry() 是一种Java 1.6方法.
请参阅http://java.sun.com/javase/6/docs/api/java/util/TreeMap.html#firstEntry().
| 归档时间: |
|
| 查看次数: |
2392 次 |
| 最近记录: |