• Post Reply Bookmark Topic Watch Topic
  • New Topic

class nodef found  RSS feed

 
Ken Rubin
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • 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
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • 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
  • 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: 42972
73
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks Ulf, now I know how to attack the problem.

Regards,

Ken
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!