Jikes rvm runtime err“找不到类java.util.Scanner”

时间:2012-06-27 15:59:10

标签: java compiler-errors jikes

当我使用Jikes rvm来运行我的程序“GenRegex.class”时,

jikesrvm-3.1.2/dist/production_x86_64-linux/rvm GenRegex grammars/cfg_nse.g

我得到了运行时错误:

Exception in thread "MainThread" java.lang.NoClassDefFoundError: Could not find the class java.util.Scanner:
        java.util.Scanner
   at java.lang.Error.(Error.java:81)
   at java.lang.LinkageError.(LinkageError.java:72)
   at java.lang.NoClassDefFoundError.(NoClassDefFoundError.java:74)
   at org.jikesrvm.classloader.TypeReference.resolveInternal(TypeReference.java:813)
   at org.jikesrvm.classloader.TypeReference.resolve(TypeReference.java:799)
   at org.jikesrvm.runtime.RuntimeEntrypoints.unresolvedNewScalar(RuntimeEntrypoints.java:264)
   at GenRegex.genRule(GenRegex.java:12)
   at GenRegex.main(GenRegex.java:1133)

以下是我的代码

   1 import java.util.*;
   2 import java.io.*;
   3 
   4 public class GenRegex{
   5 
   6   Rule[] genRule(String fileName) throws IOException
   7   {
   8     String line = "";
   9     String str = "";
  10     ArrayList ruleList = new ArrayList();
  11     Rule[] ruleArray;
  12     Scanner scanner = new Scanner(new FileInputStream(fileName));

即使我添加了一行“import java.util.Scanner;”我还是犯这个错误。任何线索?谢谢!

1 个答案:

答案 0 :(得分:0)

最后,我在Jikes RVM中发现了一些令人失望的信息“java.util.Scanner未实现”,至少在版本3.0.1中。

请参阅此链接:http://lwn.net/Articles/303938/

Jikes RVM 3.0.1 released
...
** Bug 
* [RVM-172] - Failing DaCapo benchmarks on PPC 32 OS X 
* [RVM-288] - Assertion failure in inline oracle 
* [RVM-318] - java.util.Scanner is unimplemented  
...

对于当前版本3.1.2,我不确定。