3
votes

I've installed the ANTLR4 plugin for Intellij, but cannot work with grammar files.

Upon the IDE start I immediately get:

NoClassDefFoundError:
org.antlr.intellij.plugin.ANTLRv4PluginController@109bb62:
org/antlr/v4/runtime/tree/gui/TreeViewer

Then, when I double click on a grammar file I get:

NoClassDefFoundError: org/antlr/v4/runtime/Lexer

Seems like IDE does not know where to pick the ANTLR jar file.

My project does have a dependency on antlr-4.5-complete.jar.

Are there some addition configuration steps I need to perform in order to let the IDE know where to look for the proper jar?

1
ANTLR 4.5 is baked into the plugin. Are you trying to build or just edit a grammar? Very odd. Windows? Linux? Mac? Which java. - Terence Parr
Windows 7, x64. Happens with both Java 1.7 and 1.8. I'm just trying to get started with grammars - no Java coding yet. G4 file appears greyed out, so I cannot even open it inside the IDE. BTW, what do you mean by "embedded"? In the installation folder I see 2 files - plugin.jar and antlr-4.5-complete.jar. The first is too small to embed the second inside it. - Natan
it must have unzipped those or something during installation. if you look, the plug-in itself contains all of that. Someone in my class with a Linux install seem to have something similar. Another student explain something about the preferences that I didn't get but I don't have to do anything on my Mac. can you try intellij 13 quickly? - Terence Parr
OMG... I've unzipped the intellij-plugin-v4.zip and pointed the IDE directly to the plugin.jar... Re-installed using the zip file. Now it works! Thanks and sorry! - Natan
I've done the same thing, this has saved me from pulling my hair out:) - anakic

1 Answers

4
votes

Hooray! Ok, so then the answer to this question is to ask intellij to install the plug-in. Or you can download intellij-plugin-v4.zip, but don't unzip it.