• 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

ClassNotFound errors

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've seen this problem posted numerous times, and I've tried every solution that I've seen so far, but haven't had any luck. I'm running on XP-Professional (it doesn't seem to support 'classpath', which I've seen in other postings used to correct the problem.). I've tried putting the classes12.jar file in every ext folder on my system - I've tried running the class with several IDE's and directly from the SDK - all without success.

Running WinXP-Pro; Oracle 9i, and SDK 1.4.1

Error Message:
Exception in thread "main" java.lang.NoClassDefFoundError: CollectValues
Code:


Does anybody out there have any additional ideas??

[ edited to preserve formatting using the [code] and [/code] UBB tags and to remove the evil tab characters and to disable smilies -ds ]
[ September 22, 2004: Message edited by: Dirk Schreckmann ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sicne there is really no JDBC component to this problem, I'm going to move it along to the Java in General(intermediate) forum.
 
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Show the following things:

a) The output after execution of the command 'echo %CLASSPATH%'

b) The output after the execution of the command 'dir' in the directory that you believe contains your class.

c) The command that you are issuing to receive the error ('java <something>' I assume)
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Rob!

If your current working directory is the same directory where the compiled CollectValues.class file is, then the following command should run it, no matter your current CLASSPATH value.

java -cp . CollectValues

Does that work but just java CollectValues doesn't? If so, then the problem is that your CLASSPATH doesn't include the current working directory, as specified by a period.

For the steps to set the CLASSPATH environment variable on Windows XP, take a look at http://faq.javaranch.com/view?HowToSetTheClasspath

Of course, the location of the Oracle JDBC drive will need to be in your CLASSPATH, as well, in order for your code to run without error.
 
Rob Gee
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a)
C:\>echo %classpath%
c:\oracle\ora92\jdbc\lib\classes12.zip; c:\jdk14\jdk\bin

b) C:\oracle\ora92\jdbc\lib>dir
Volume in drive C has no label.
Volume Serial Number is AC7C-7F9A

Directory of C:\oracle\ora92\jdbc\lib

03/30/2004 07:12 PM <DIR> .
03/30/2004 07:12 PM <DIR> ..
04/26/2002 03:47 PM 1,033,402 classes111.jar
04/26/2002 03:47 PM 1,043,528 classes111.zip
04/26/2002 03:47 PM 1,371,600 classes111_g.jar
04/26/2002 03:47 PM 1,381,728 classes111_g.zip
04/26/2002 03:47 PM 1,196,109 classes12.jar
04/26/2002 03:47 PM 1,207,068 classes12.zip
04/26/2002 03:47 PM 1,201,552 classes12dms.jar
04/26/2002 03:47 PM 1,438,406 classes12dms_g.jar
04/26/2002 03:47 PM 1,432,813 classes12_g.jar
04/26/2002 03:47 PM 1,443,734 classes12_g.zip
04/26/2002 03:47 PM 1,781,005 nls_charset11.jar
04/26/2002 03:47 PM 1,810,518 nls_charset11.zip
04/26/2002 03:47 PM 1,781,898 nls_charset12.jar
04/26/2002 03:47 PM 1,811,415 nls_charset12.zip
04/26/2002 03:47 PM 36,640 ocrs12.jar
04/26/2002 03:47 PM 36,664 ocrs12.zip
04/26/2002 03:47 PM 1,174,976 ojdbc14.jar
04/26/2002 03:47 PM 1,383,922 ojdbc14_g.jar
18 File(s) 22,566,978 bytes
2 Dir(s) 20,522,364,928 bytes free

c) java CollectValues
I've also tried java -cp c:\oracle\ora92\jdbc\lib\classes12.zip CollectValues

Thanks again for your help.

rob


Originally posted by Tony Morris:
Show the following things:

a) The output after execution of the command 'echo %CLASSPATH%'

b) The output after the execution of the command 'dir' in the directory that you believe contains your class.

c) The command that you are issuing to receive the error ('java <something>' I assume)

 
Rob Gee
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All. Thanks for your help.

Problem resolved - of course it was a simple classpath problem !!
 
reply
    Bookmark Topic Watch Topic
  • New Topic