-1

While running a scheduler program through command prompt, I am getting the below error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/quartz/ScheduleBu
ilder
Caused by: java.lang.ClassNotFoundException: org.quartz.ScheduleBuilder
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: ScheduleEmail.  Program will exit.

Even after adding all the jar files also I am getting the following.

Java command : java - cp .;E:/Jars/*; ScheduleEmail

Can anyone please suggest why I am getting this?

epoch
  • 16,396
  • 4
  • 43
  • 71
Bharath R
  • 1,491
  • 1
  • 11
  • 23
  • 1
    as far as I know wildcards do not work in classpath. You need to specify jar files directly. –  Aug 21 '14 at 06:11
  • 1
    You can't use wildcards in your classpath, you need to specify each and every Jar file...individually :) – MadProgrammer Aug 21 '14 at 06:11
  • But I took this as a consideration , http://stackoverflow.com/questions/6069702/java-command-line-with-external-jar – Bharath R Aug 21 '14 at 06:13
  • E:/Jars/* doesnot add all your jars to classpath. Either add them manually of create a script to build the full jar names based class path string. – Nazgul Aug 21 '14 at 06:14

2 Answers2

0

first, make sure if there is a typo, there's no space between "-" and "cp" second, check if quarts jars are in E:/Jars/

Laurence Geng
  • 424
  • 3
  • 9
0

When using a wildcard (on windows platform), you need to surround it with quotes to work correctly:

java -cp ".;E:/Jars/*;" ScheduleEmail

1. http://docs.oracle.com/javase/6/docs/technotes/tools/windows/classpath.html

epoch
  • 16,396
  • 4
  • 43
  • 71