and got an error message: Can't read file.
I typed the file just like in page 6 of the book Head First Java but I keep getting the message. I wonder what's wrong.
Be sure that you are cd-ing to the correct folder, and that the folder structure reflects any package hierarchy.
It might be best if you showed us the complete code of your class (please use UBB code tags to preserve the formatting), the exact command line that you are using, and the exact wording of the error message.
My guess is that you're just not changing to the correct directory. As Bear said above, "Be sure that you are cd-ing to the correct folder." When you start Terminal, type "cd" (without quotes) to Change Directory, followed by a space and the path for the folder that your .java file is in (using forward slashes between folders). For example, at your "userName$" prompt...
...userName$ cd java/tests
.../java/tests userName$ javac MyFile.java
.../java/tests userName$ java MyFile
Originally posted by Kevin Tysen:
I did the cd command like you said. It worked! Thank you everybody!
In the Mac terminal, what computer language do you use? Is that DOS or Unix commands or part of java language or what?
OS/X is a BSD Unix derivative. Almost enough to make me go back to the Mac for my next machine...
Originally posted by Kevin Tysen:
...In the Mac terminal, what computer language do you use? Is that DOS or Unix commands or part of java language or what? ...
In OS 10.3 and 10.4, the default shell for Terminal is bash (Bourne-Again SHell). The default for earlier OS X versions is tcsh (TENEX C SHell). As of 10.2, zsh can also be run.
This is straying into Mac-specific territory, and JavaRanch has a separate board for that.
[ October 28, 2005: Message edited by: marc weber ]
Originally posted by marc weber:
I recently switched. You won't regret it!
It would be switching back, actually. I bought my first Mac in 1986. But it became harder and harder to justify having one as my "primary" machine, since I started using Java as my primary development environment in 1997. Eventually, I gave up and went over to The Dark Side.
Now, with four people in the house at the moment, there are two iMacs, two XP boxes, a running Fedora Core 3...and Brutus, the (smokin' hot!) PPC 9500. Woo!
I really can't justify another CPU - even if the new dual-core G5s look...sweet. Very sweet. Sigh.
(are we gonna get moved to Mac-land? Probably - especially if we continue down this particular trail. I follow threads where e'er they lead...)
Originally posted by Grant Gainey:
... I bought my first Mac in 1986. But it became harder and harder to justify having one as my "primary" machine...
Yeah, the 90's were troubled for Apple. I didn't own a computer in the 80's (when I was more interested in guitars), and I couldn't justify a Mac until they started turning things around again.
Although I obviously like doing certain things with computers, I've never liked the machines themselves. The Mac is Different. This is the first computer I've really enjoyed.
I had the original Mac 128K in 1984. I moved to PCs in 1992, and will never go back. I am having much more fun on PCs. I keep trying the Macs, but I just feel so limited with the number of applications available. Lets see, I can Itunes, IMovies, IBrowse, and IWordProcess and ISpreadsheet. Does that cover everything? ;0
Originally posted by Mark Spritzler:
... I am having much more fun on PCs. I keep trying the Macs, but I just feel so limited with the number of applications available...
Hmmm... I suppose these things happen.
It's true that Macs (in their current state) are not the best choice for everyone. But I think that's changing. The only application I would have liked to continue using on Mac is Sony's Acid Pro (for loop-based music production). But I suspect that once I get up to speed on GarageBand (or Logic Express or Cubase), I'll be more than happy to leave Acid behind.
On a Java note, I've just started a Swing project, and it looks SO cool on the Mac!