0

I saw running jar from command line.

However my case is different. I put the jars needed for the main class under lib folder. So my jar is like this:

lib
META-INF
VideoFieldsResults.class

in the META-INF I have:

Manifest-Version: 1.0
Main-Class: VideoFieldResults

when I try to run:

java -jar VideoFormat.jar onBa32hgnBg,Lh-BKkLYYBU C:\VideoFormat2.csv

Where the last 2 are arguments I get:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/gdata/util
/ServiceException

Which does exists under one of the jars inside!

How can I run a command line specifying that all the jars under lib folder inside are required for the jar?

Community
  • 1
  • 1
Dejell
  • 13,947
  • 40
  • 146
  • 229
  • possible duplicate of [Classpath including JAR within a JAR](http://stackoverflow.com/questions/183292/classpath-including-jar-within-a-jar) – Brian Roach May 14 '11 at 22:38

1 Answers1

2

By default, Java cannot load jars from within jars. To accomplish this, you would need a classloader that can handle it. For example One-Jar. There are other options as well (depending on how set you are with including jars inside of a jar or if flattening jars is an option), I'd recommend the answer to this other question

Community
  • 1
  • 1
Charlie
  • 7,181
  • 1
  • 35
  • 49