I am not sure why but I am getting error when trying to run my java file in cmd using javac MyCompiler.java
. The file runs fine when I run it from Intellij. I have already added C:\Program Files\Java\jdk1.8.0_144\bin
to class path.
The error I am getting:
MyCompiler.java:4: error: package org.antlr.v4.gui does not exist
import org.antlr.v4.gui.TreeViewer;
^
MyCompiler.java:5: error: package org.antlr.v4.runtime.tree does not exist
import org.antlr.v4.runtime.tree.*;
^
MyCompiler.java:6: error: package org.antlr.v4.runtime does not exist
import org.antlr.v4.runtime.*;
^
.\CompilerBaseVisitor.java:2: error: package org.antlr.v4.runtime.tree does
not exist
import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
^
.\CompilerBaseVisitor.java:12: error: cannot find symbol
public class CompilerBaseVisitor<T> extends AbstractParseTreeVisitor<T>
implements CompilerVisitor<T> {
^
symbol: class AbstractParseTreeVisitor
.\CompilerVisitor.java:2: error: package org.antlr.v4.runtime.tree does not
exist
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
^
.\CompilerVisitor.java:11: error: cannot find symbol
public interface CompilerVisitor<T> extends ParseTreeVisitor<T> {
^
symbol: class ParseTreeVisitor
.\CompilerParser.java:2: error: package org.antlr.v4.runtime.atn does not
exist
import org.antlr.v4.runtime.atn.*;
^
.\CompilerParser.java:3: error: package org.antlr.v4.runtime.dfa does not
exist
import org.antlr.v4.runtime.dfa.DFA;
^
.\CompilerParser.java:4: error: package org.antlr.v4.runtime does not exist
import org.antlr.v4.runtime.*;
^
.\CompilerParser.java:5: error: package org.antlr.v4.runtime.misc does not
exist
import org.antlr.v4.runtime.misc.*;
^
.\CompilerParser.java:6: error: package org.antlr.v4.runtime.tree does not
exist
import org.antlr.v4.runtime.tree.*;
The error seems to be ANTLR related but I am not sure how to fix it. Any help will be appreciated.