3

I'm trying to run a jar file that uses the YouTube Data API and I'm getting a NoClassDefFoundError for one of the API classes:

alt text http://img205.imageshack.us/img205/1808/noclassdeffounderror.png

AuthenticationException.class is found in the gdata-core-1.0 jar:

alt text http://img683.imageshack.us/img683/7329/authenticationexception.png

The gdata-core-1.0 jar has been added to my classpath:

alt text http://img24.imageshack.us/img24/2195/classpathe.png

What am I doing wrong?

Anthony
  • 722
  • 1
  • 9
  • 25

1 Answers1

0

Perhaps you may not be having the jar in the classpath. The command prompt execution does not set the classpath. You will have to either do it by yourselves or give it on the fly while executing.

You should probably take a look at setting the MANIFEST file correct for the JAR file.

This post has a better description

bragboy
  • 34,892
  • 30
  • 114
  • 171
  • It's highlighted in the last image – Anthony Jun 16 '10 at 17:59
  • Yes, but the exception you're getting is in the command prompt and not in the Eclipse. Correct me if I'm wrong – bragboy Jun 16 '10 at 18:00
  • The classpath created in Eclipse is in the the jar file that I try to run. Do I need to set it again in the command prompt? – Anthony Jun 16 '10 at 18:02
  • Ah!! Got it!! There will be a file called MANIFEST.MF in the jar, you will have to set the classpath there!! See my updated answer – bragboy Jun 16 '10 at 18:07