Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 707068 - dev-java/antlr-4.5.1 - java.lang.NoClassDefFoundError: org/antlr/runtime/RecognitionException
Summary: dev-java/antlr-4.5.1 - java.lang.NoClassDefFoundError: org/antlr/runtime/Reco...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-29 06:47 UTC by Daiajo Tibdixious
Modified: 2020-01-29 12:02 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daiajo Tibdixious 2020-01-29 06:47:40 UTC
dev-java/antlr-4.5.1 pulls in ev-java/treelayout-1.0.2 and dev-java/stringtemplate-4.0.8
export CLASSPATH=/usr/share/antlr-4/lib/antlr-runtime.jar:/usr/share/antlr-4/lib/antlr-tool.jar:/usr/share/treelayout/lib/treelayout.jar:/usr/share/stringtemplate-4/lib/stringtemplate.jar

java org.antlr.v4.Tool
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/antlr/runtime/RecognitionException
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
        at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
        at java.lang.Class.getMethod0(Class.java:3018)
        at java.lang.Class.getMethod(Class.java:1784)
        at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.antlr.runtime.RecognitionException
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 7 more

I then downloaded https://www.antlr.org/download/antlr-4.7.1-complete.jar
export CLASSPATH=/usr/share/antlr-4.7.1/antlr-4.7.1-complete.jar
alias antlr='java -Xmx500M -cp $CLASSPATH org.antlr.v4.Tool'
java org.antlr.v4.Tool
ANTLR Parser Generator  Version 4.7.1
 -o ___              specify output directory where all output is generated
 -lib ___            specify location of grammars, tokens files
 -atn                generate rule augmented transition network diagrams
 -encoding ___       specify grammar file encoding; e.g., euc-jp
 -message-format ___ specify output style for messages in antlr, gnu, vs2005
 -long-messages      show exception details when available for errors and warnings
 -listener           generate parse tree listener (default)
 -no-listener        don't generate parse tree listener
 -visitor            generate parse tree visitor
 -no-visitor         don't generate parse tree visitor (default)
 -package ___        specify a package/namespace for the generated code
 -depend             generate file dependencies
 -D<option>=value    set/override a grammar-level option
 -Werror             treat warnings as errors
 -XdbgST             launch StringTemplate visualizer on generated code
 -XdbgSTWait         wait for STViz to close before continuing
 -Xforce-atn         use the ATN simulator for all predictions
 -Xlog               dump lots of logging info to antlr-timestamp.log
 -Xexact-output-dir  all output goes into -o dir regardless of paths/package
So it works.
Its disappointing that the gentoo install produces are worse result than a manual install.