Note that there are some explanatory texts on larger screens.

plurals
  1. POjava classpath in shell
    primarykey
    data
    text
    <p>here is a shell script:</p> <pre><code>#!/bin/sh cd ../../../lib ls MY_LIB=`pwd` for jar in `ls $MY_LIB/*.jar` do CLASSPATH="$CLASSPATH:""$jar" done echo $CLASSPATH cd .. #java -jar build/libs/myproject.jar -classpath \"$CLASSPATH\" </code></pre> <p>run this script will print that:</p> <pre><code>commons-codec-1.6.jar httpclient-4.2.1.jar httpcore-4.2.1.jar logback-classic-1.0.6.jar slf4j-api-1.6.0.jar commons-logging-1.1.1.jar httpclient-cache-4.2.1.jar httpmime-4.2.1.jar logback-core-1.0.6.jar :/home/user/mygitproject/myproject/lib/commons-codec-1.6.jar:/home/user/mygitproject/myproject/lib/commons-logging-1.1.1.jar:/home/user/mygitproject/myproject/lib/httpclient-4.2.1.jar:/home/user/mygitproject/myproject/lib/httpclient-cache-4.2.1.jar:/home/user/mygitproject/myproject/lib/httpcore-4.2.1.jar:/home/user/mygitproject/myproject/lib/httpmime-4.2.1.jar:/home/user/mygitproject/myproject/lib/logback-classic-1.0.6.jar:/home/user/mygitproject/myproject/lib/logback-core-1.0.6.jar:/home/user/mygitproject/myproject/lib/slf4j-api-1.6.0.jar Exception in thread "main" java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/JoranException at com.test.MainTest.main(MainTest.java:223) Caused by: java.lang.ClassNotFoundException: ch.qos.logback.core.joran.spi.JoranException 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:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 1 more </code></pre> <p>why do i get the exception? </p> <p>is the classpath wrong?</p> <p>is the java -classpath using incorrect?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload