Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Mock Exam Question

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

I've tried running this program but everytime it is is giving "Exception in thread main : java.lang.NoClassDefFound test. I'm compiling the program with -Xlint:unchecked option.



Plz help on this as I've exam on 28th and still I'm not doing good in generics.

Thanks
 
Ranch Hand
Posts: 2412
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did it compile without any errors?

Also what is your CLASSPATH?
 
Asha Pathik
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It compiled with one warning but i think we can still run such a class file.

And I think this is my classpath:

C:\Program Files\Java\jre1.5.0_03\lib\ext\QTJava.zip

I got this from Control Panel->System->Advance->Environment Variables ->System Variables

Thanks
 
Keith Lynn
Ranch Hand
Posts: 2412
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this.

java -cp . test
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably a good idea to unset the CLASSPATH altogether with:

Yes, that's "equals nothing"

It's interesting how installing QuickTime can mess things up. What happens to QT when you deinstall java 1.5.0_03 and install the latest 1.5.0_07 version? :roll:
[ June 26, 2006: Message edited by: Barry Gaunt ]
 
Asha Pathik
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Keith and Barry. It is working fine now and finally i'm able to run all my generics examples.

Thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic