aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Can't get Max's app to run Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Can Watch "Can New topic
Author

Can't get Max's app to run

Daniel Simpson
Ranch Hand

Joined: Sep 02, 2004
Posts: 181
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 ]

SCJP 1.4<br />SCJD 1.4
Dieskun Koper
Ranch Hand

Joined: Aug 15, 2004
Posts: 85
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

Joined: Sep 02, 2004
Posts: 181
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

Joined: Aug 15, 2004
Posts: 85
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't get Max's app to run