我是java和ANTLR的初学者。 我想在Netbeans IDE中使用ANTLR。 我试图运行一个示例示例,并且按照所需的所有重要步骤来设置环境变量,包括jar文件和修改built.xml。错误:无法找到或加载主类org.antlr.Tool
但是,当我试图清理和建立我的申请,我得到以下错误:
Error: Could not find or load main class org.antlr.Tool
Java Result: 1
Created dir: ../NetBeansProjects/AntlrTestApp/build/empty
Created dir: ../NetBeansProjects/AntlrTestApp/build/generated-sources/ap-source-output
Compiling 1 source file to ../NetBeansProjects/AntlrTestApp/build/classes
../NetBeansProjects/AntlrTestApp/src/antlrtestapp/AntlrTestApp.java:24: error: cannot find symbol
grammarLexer lexer = new grammarLexer(input);
symbol: class grammarLexer
location: class AntlrTestApp
../NetBeansProjects/AntlrTestApp/src/antlrtestapp/AntlrTestApp.java:24: error: cannot find symbol
grammarLexer lexer = new grammarLexer(input);
symbol: class grammarLexer
location: class AntlrTestApp
../NetBeansProjects/AntlrTestApp/src/antlrtestapp/AntlrTestApp.java:26: error: cannot find symbol
grammarParser parser = new grammarParser(tokens);
symbol: class grammarParser
location: class AntlrTestApp
../NetBeansProjects/AntlrTestApp/src/antlrtestapp/AntlrTestApp.java:26: error: cannot find symbol
grammarParser parser = new grammarParser(tokens);
symbol: class grammarParser
location: class AntlrTestApp
../NetBeansProjects/AntlrTestApp/src/antlrtestapp/AntlrTestApp.java:29: error: cannot find symbol
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
symbol: class Main
location: class AntlrTestApp
../NetBeansProjects/AntlrTestApp/src/antlrtestapp/AntlrTestApp.java:31: error: cannot find symbol
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
symbol: class Main
location: class AntlrTestApp
6 errors
../NetBeansProjects/AntlrTestApp/nbproject/build-impl.xml:603: The following error occurred while executing this line:
../NetBeansProjects/AntlrTestApp/nbproject/build-impl.xml:244: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 1 second)
我一直自去年2-3天尝试此,并寻找所有可能的解决方案,但没有为我工作。
@HinataHyuga请不要使用粗体格式将所有关键词/名称加粗;它使帖子更难阅读。 – 2013-03-18 17:40:07
@AndrewBarber好的。现在我会照顾它。 :) – 2013-03-18 17:42:00