• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

class nodef found

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Asking about this topic is a bit embarassing

I'm try to run an executable with the following conditions:

My top level directory is C:\ebayJavaSDK\SDKInstallDir\samples\JSDKToSoap

The source code is one file at C:\ebayJavaSDK\SDKInstallDir\samples\JSDKToSoap\com\ebay\migration\CallJsdk.java. It has a package of com.ebay.migration.

The class file is at C:\ebayJavaSDK\SDKInstallDir\samples\JSDKToSoap\classes\com\ebay\migration.

When I try to run the code at the C:\ebayJavaSDK\SDKInstallDir\samples\JSDKToSoap\classes> directory by typing

java com.ebay.migration.CallJsdk, I get Exception in thread "main" java.lang.NoClassDefFoundError: com/ebay/sdk/SdkException.

or

java -classpath "C:\ebayJavaSDK\SDKInstallDir\samples\JSDKToSoap\classes" com.ebay.migration.CallJsdk - I get the same thing.

Can someone please give some assistance? I should know this.

Thanks,

Ken
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unless there is a class file C:\ebayJavaSDK\SDKInstallDir\samples\JSDKToSoap\classes\com/ebay/sdk/SdkException.class it seems that you need to add whatever library contains that class to your classpath.
 
Ken Rubin
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for responding so quickly!

When I do the following command

C:\ebayJavaSDK\SDKInstallDir\samples\JSDKToSoap\classes>java -classpath "C:\ebay
JavaSDK\SDKInstallDir\externalLib\axis-1_1;C:\ebayJavaSDK\SDKInstallDir\lib" com
.ebay.migration.CallJsdk

I get the exception for the CallJsdk:
Exception in thread "main" java.lang.NoClassDefFoundError: com/ebay/migration/CallJsdk

Not sure why.

Thanks,

Ken
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to add individual jar files to the classpath, not the directories where those jar files live. Adding directories to the classpath will cause loose class files to be picked up, but not jar files.
 
Ken Rubin
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ulf, now I know how to attack the problem.

Regards,

Ken
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic