1

I'm trying to use javaparser plugin of JQAssistant using command line. I have done the following:

  • Copied "jqassistant.plugin.javaparser-1.8.0.jar" to "plugin" folder.
  • I also noticed plugin has runtime dependency to "com.github.javaparser:javaparser-core:3.6.25". So I copied "javaparser-core-3.6.25.jar" to plugin folder too.

But when I try to scan a Java file I get the following error: "ANTLR Tool version 4.9.2 used for code generation does not match the current runtime version 4.7.2"

The ANTLR version bundled with JQAssistant is 4.9.2 but plugin is expecting older version 4.7.2. Has anyone been able to use javaparser plugin?

hmozaffari
  • 31
  • 3
  • 1
    I tried jQA 1.10 with org.antlr-antlr4-runtime-4.9.2.jar, javaparser-core-3.6.25.jar and jqassistant javaparser plugin. Was able to parse a large number of Java source files. Can you give an example where the error mentioned occurs? – Jens Nerche Sep 16 '22 at 07:30
  • Thanks @JensNerche for trying it. I used JQA1.12, org.antlr-antlr4-runtime-4.9.2.jar and javaparser-core-3.6.25.jar and get error below and scan halts: `ANTLR Tool version 4.9.2 used for code generation does not match the current runtime version 4.7.2ANTLR Runtime version 4.9.2 used for parser compilation does not match the current runtime version 4.7.2` Also logs shows a VM halt `WARN [o.n.k.i.c.VmPauseMonitorComponent] Detected VM stop-the-world pause: {pauseTime=649, gcTime=734, gcCount=2}` – hmozaffari Sep 16 '22 at 19:29
  • Another observation. I got that error when I scanned large number of source files. Scanning a small hello world project with 30 classes is successful. I don't understand why I get ANTLR version mismatch for large projects and not small one. – hmozaffari Sep 16 '22 at 19:57

1 Answers1

1

Some plugins (not only javaparser) indeed depend on JARs bundled with jQAssistant. Sometimes there are version conflicts, that's why it can only be guaranteed that Kontext E plugins with a certain version (let's say 1.8.x) are compatible with jQAssistant with the same major and minor version (so jQA 1.8 in this case). If you use javaparser 1.8.0 with jQAssistant 1.8.0 (which comes with org.antlr-antlr4-runtime-4.7.2), it works.

Jens Nerche
  • 118
  • 8