当我使用 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;”之后我仍然遇到这个错误。有什么线索吗?谢谢!
最佳答案
最后,我在 Jikes RVM 中发现了一些令人失望的信息“java.util.Scanner is unimplemented”,至少在 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,我不确定。
关于java - Jikes rvm运行时错误 "Could not find the class java.util.Scanner",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11230433/