This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can't get Max's app to run

 
Daniel Simpson
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • 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 ]
 
Dieskun Koper
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic