• 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

Can't get Max's app to run

 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I feel pretty dumb not being able to get Max's app to run. Anybody know why? I followed all of the instructions, yet when I try to run it, I get this error:

If anyone is not as dumb as me, you're help is appreciated.
[ January 02, 2005: Message edited by: Daniel Simpson ]
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Daniel,

I don't have Max's application but with such a stacktrace it seems trivial to figure out the cause: you don't have db.DVD in your CLASSPATH. Try to figure out why!

You are not setting the classpath explicitly, so your system's or command prompt/shell's CLASSPATH is used. Does it contain the directory that contains db\DVD.class? Did DVD.java compile successfully? Did you compile it with the -d . option so that the class file is actually created in the directory with the package name? Maybe Max had it in his classpath and you don't, or the JDK Max used sets the -d . option by default and your JDK does not. Or he forgot to write it in his book and it has been added to an errata list?

Good luck!
Dies
 
Daniel Simpson
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Dieskun Koper:
Hi Daniel,

I don't have Max's application but with such a stacktrace it seems trivial to figure out the cause: you don't have db.DVD in your CLASSPATH. Try to figure out why!

You are not setting the classpath explicitly, so your system's or command prompt/shell's CLASSPATH is used. Does it contain the directory that contains db\DVD.class? Did DVD.java compile successfully? Did you compile it with the -d . option so that the class file is actually created in the directory with the package name? Maybe Max had it in his classpath and you don't, or the JDK Max used sets the -d . option by default and your JDK does not. Or he forgot to write it in his book and it has been added to an errata list?

Good luck!
Dies


I followed everything by the book: did the -d option and everything. I'm not quite sure what else I could have possibly done wrong.
 
Dieskun Koper
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I don't have the book. It is quite possible that it has a mistake in it. It should be easy to solve:
Check if you have a DVD.class in a subdirectory called db
If so:
Check if this class is in your CLASSPATH: Run 'javap db.DVD' and you'll know:
If error, make sure you are currently in the directory that contains that db directory, and make sure '.' (the current directory) is in your CLASSPATH.

If there is a DVD.class but not in a db directory:
1. Make sure DVD.java has the following line "package db;"
2. Compile again, make sure you use -d .

If no DVD.class at all, compile DVD.java. Make sure there are no error messages.

If you did not understand what I wrote, please type 'dir /b /s DVD.class' and 'cd' in the command prompt (assuming you're using Windows) and post the output.
 
reply
    Bookmark Topic Watch Topic
  • New Topic