I run a shell script that should execute the main
method:
java -classpath /path/to/app/conf/lib/nameJar* com.example.ClassTest
At this point, I get this exception:
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContext at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
This is because spring banks are in a different folder. So, I changed the script:
java -classpath /path/to/app/conf/lib/nameJar*:/path/to/app/lib/spring* com.example.ClassTest
But with this script, com.example.ClassTest could not be found. Any ideas on this issue?
Thanks in advance
source share