-1

When I give the following command

java -Xmx500m -jar bc.jar %1 %2 %3 %4 %5 %6 %7 %8 %9

I am getting the following Exception

    Throwable Error: java.lang.NoClassDefFoundError: org/supercsv/prefs/CsvPreference
Exception in thread "main" java.lang.Error: java.lang.NoClassDefFoundError: org/supercsv/prefs/CsvPreference
        at bc.c.Util.process(Util.java:135)
        at bc.m.TabularReader$CSVReader.<init>(TabularReader.java:68)
        at bc.m.TabularReader.<init>(TabularReader.java:37)
        at bc.c.Spread2db.main(Spread2db.java:244)
Caused by: java.lang.NoClassDefFoundError: org/supercsv/prefs/CsvPreference
        at bc.m.TabularReader$CSVReader.<init>(TabularReader.java:64)
        ... 2 more
Caused by: java.lang.ClassNotFoundException: org.supercsv.prefs.CsvPreference
        at java.net.URLClassLoader$1.run(Unknown Source)
        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)
        ... 3 more

I guess that this is due to the improper inclusion of supercsv.

Can anybody help me fixing this?

Anand
  • 1,067
  • 3
  • 11
  • 24

1 Answers1

0

Sounds like Super CSV isn't on the classpath, and as you're not supplying the classpath with -cp I would check the manifest in your jar to see where it expects the super-csv jar to be (probably in the same directory), then confirm that it's actually there.

This seems to be a fairly good overview of the different ways of configuring the classpath when running jars.

James Bassett
  • 9,458
  • 4
  • 35
  • 68