This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Head First Java (2nd Ed.) p. 112

 
marsooka
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The instructions on page 112 are to "Drop all three classes(...) into the same directory...
my question is based on the fact that the only successful class/java-file i compiled was the one called GameHelper. What is the exact syntax and file name(s) of the other two supposed to be, i've tried many and continue to get compile errors...
the other two (saved in one .java file together, or two separate .java files) are referred to as SimpleDotCom and SimpleDotComGame.

thanks, marsooka
[ December 31, 2006: Message edited by: barclay mcdaniel ]
 
Bert Bates
author
Sheriff
Posts: 8898
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Barclay,

Can you tell us a little more about exactly what files you have (their exact names), what directory(ies) they are in, what compiler command you're using, and exactly what errors you're getting?

Thanks!

Bert
 
Davy Kelly
Ranch Hand
Posts: 384
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think what they are trying to say is that the 3 classes should be in the same directory e.g. C:\Program Files\Java\jdk1.5.0_03 so that you can compile and run them you only compile the SimpleDotComTestDrive file and the rest should compile automatically

then run it.

so to re-iterate, have all 3 java files in a directory typically, where the bin file is.

save all 3 files with their Class_Name.java, here is the code:




compile "javac SimpleDotComTestDrive.java" this will in turn compile the rest, then run it java SimpleDotComTestDrive this should run all 3 classes as the game.

davy
[ December 31, 2006: Message edited by: Davy Kelly ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Barclay,
Yes, each (public) class should be in a separate file. When you compile them, be sure to compile in one step so all the classes are found.

>javac *.java
 
marsooka
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks...
[ December 31, 2006: Message edited by: barclay mcdaniel ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic