1
当我使用的Jikes RVM运行我的节目 “GenRegex.class”,的Jikes RVM运行时错误 “找不到类java.util.Scanner中的”
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));
即使我添加一行 “进口java.util.Scanner的;”我仍然有这个错误。任何线索?谢谢!
我对Jikes并不熟悉。是否有可能需要手动(通过GUI)在项目中包含一些“标准”Java库?当我得到一个运行时NoClassDefFoundError时,通常它是一个库/依赖项问题。 – BlackVegetable
@BlackVegetable也许问题来自GNU Classpath。 – JackWM