| Article: |
Building a Simple Java Application in Mac OS X | |
| Subject: | Also having trouble with first page | |
| Date: | 2002-09-24 08:17:22 | |
| From: | anonymous2 | |
|
Running 10.1.5 with December 2001 dev tools. First application compiles fine, but
|
||
Showing messages 1 through 1 of 1.
-
Author's response
2003-02-10 07:38:05 Daniel H. Steinberg |
[View]



Using what you have done. You created a directory called ninesquares inside of which you create a file called NineSquares.java. The first line of NineSquares.java should read "package ninesquares;" The case must match the name of the directory -- the package structure and the directory structure must match. To compile this file you need to be outside of the ninesquares directory. You can compile it with the command "javac ninesquares/NineSquares.java". According to your listing you have tried to compile it from inside of the ninesquares directory.
Once you have compiled it (again continuing with your directory structure) you then must run it from outside of the ninesquares directory with the command "java ninesquares/NineSquares". This command effectively says look inside of the ninesquares directory and run the NineSquares.class file's main method.
Daniel