Jump to content
  • Advertisement
Sign in to follow this  
cptrnet

[java] Problem compiling book code

This topic is 4846 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I bought the book Practical Java Game Programming and it won't run. I've tried to compile it and it won't compile. Should I just say to heck with the book, because it is outdated, its pre 1.5.

Share this post


Link to post
Share on other sites
Advertisement
Any particular reason why it won't compile? I wouldn't call pre-1.5 things outdated just yet. 1.5 didn't do much to make the type of things taught in that sort of book obsolete. Sure you might have some depreciated methods, but the API documentation should tell you a lateral-movement alternative.

Share this post


Link to post
Share on other sites
Hi thanks for the replies. The book is Practical Java Game Programming. I've read the review on amazon and some say the book is incomplete or whatever. They just show snippets. Thats why I'm going through the cd. There are some things that are in the book that are wrong also. Thats why I want to get a new book. I'm sorry what I meant to say is that it doesn't run. It compiles and makes the class saying that some things are deprecated. Then I try to run the class and it says it can't find it or something. It's probably stupidity on my part. Exception in thread "main" java.lang.NoClassDefFoundError: FullScreenFrame1 (wrong name: book/fullscreen/FullScreenFrame1) at java.lang.ClassLoader.defineClass1(Native Method). Sorry I'm just trying to go through the book, I had to look for hours just how to find out compile and run something. The book doesn't even go through that.

Share this post


Link to post
Share on other sites
Quote:
Original post by cptrnet
Sorry I'm just trying to go through the book, I had to look for hours just how to find out compile and run something. The book doesn't even go through that.


Don't take me bad, but game programming requires a certain degree of knowledge in the target language, so the book doesn't have to go through these things, it's up to you to get acquainted with the language you want to use ;)

BTW, I would suggest you this book: Developing Games in Java, by David Brackeen - once you learn a bit more of Java.

Son Of Cain

Share this post


Link to post
Share on other sites
Can you help me with my problem with the book? I can look up how to do things on google that the book doesn't go through. I can go through the code and see what it does, but thats my problem I can't run it. Thats why I came here.

Share this post


Link to post
Share on other sites
Sounds like a classpath problem. Make sure:

The class file is in the correct spot.
book/fullscreen/FullScreenFrame1.class

Move to the directory that contains the above. ie
c:/Projects/book/fullscreen/FullScreenFrame1.class
Move to c:/Projects

Execute the program using:
java book.fullscreen.FullScreenFrame1

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!