首页 > 解决方案 > 无法找到或加载主类 org.antlr.Tool

问题描述

我正在尝试交叉编译 CVC4,调用后make出现以下错误:

[ 92%] Generating smt2/Smt2Lexer.c, smt2/Smt2Lexer.h, smt2/Smt2Parser.c, smt2/Smt2Parser.h, smt2/Smt2.tokens
Error: Could not find or load main class org.antlr.Tool
src/parser/CMakeFiles/cvc4parser.dir/build.make:93: recipe for target 'src/parser/smt2/Smt2Lexer.c' failed
make[2]: *** [src/parser/smt2/Smt2Lexer.c] Error 1
CMakeFiles/Makefile2:394: recipe for target 'src/parser/CMakeFiles/cvc4parser.dir/all' failed
make[1]: *** [src/parser/CMakeFiles/cvc4parser.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

但是,如以下命令所示,可以找到该类:

$ java org.antlr.Tool
ANTLR Parser Generator  Version 3.4
usage: java org.antlr.Tool [args] file.g [file2.g file3.g ...]

任何想法为什么在此make过程中无法加载类?我已经在CLASSPATH中添加了对应的jar。

标签: makefilecmakecross-compilingantlrclassloading

解决方案


推荐阅读