cambecc / grib2json

converts GRIB2 files to JSON
MIT License
356 stars 154 forks source link

Java NoClassDefFoundError #12

Closed fox91 closed 9 years ago

fox91 commented 9 years ago

I have a problem, probably the same of issue #2. These are the commands I used:

git clone https://github.com/cambecc/grib2json.git
cd grib2json/
mvn package
export JAVA_HOME=/usr

now I have two directory: src/ and target/. If I run the command bash src/bin/grib2json (why you not chmod +x grib2json in the repository?) it give me Error: Unable to access jarfile src/bin/../lib/grib2json-*.jar.

I need to:

mv src/bin/ ./
mv target/ lib/

Now I can run bash bin/grib2json but the output is:

Exception in thread "main" java.lang.NoClassDefFoundError: com/lexicalscope/jewel/JewelRuntimeException
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2625)
        at java.lang.Class.getMethod0(Class.java:2866)
        at java.lang.Class.getMethod(Class.java:1676)
        at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: com.lexicalscope.jewel.JewelRuntimeException
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        ... 6 more
gka commented 9 years ago

in the target folder you find a grib2json-SNAPSHOP.tar.gz. Unpack that archive and use the bin/grib2json that's inside it. Worked for me.

fox91 commented 9 years ago

Ok, this works for me! Sorry but I did not realize this step. Thank you