Dave Tolls wrote:Head First is an old book (15 years old now I believe) and so the installation instructions are out of date.
As Carey says, if you're getting a response back from a 'javac -version' call then it has installed.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Carey Brown wrote:$ javac -version
javac 14.0.2
That is the correct response to the command and means that your install is working.
$ javac Party.java
Party.java not found
Means that either the file 'Party.java' does not exist or is not in your current working directory. You may have to provide a full or relative path to the file.
Tim Holloway wrote:
Dave Tolls wrote:Head First is an old book (15 years old now I believe) and so the installation instructions are out of date.
As Carey says, if you're getting a response back from a 'javac -version' call then it has installed.
Is MacOS that old? Things changed a lot over the last 2 decades in the Macintosh world.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
fred rosenberger wrote:I am not a Mac person, so i can't be much help...
where did you save your file named "Party.java"? Since folders can be in folders which can be in folders, the full path means every single one, all the way up to the top level.
a "relative path" means relative to where you are currently. I believe the mac OS is linux based. so if you are on a command line (or whatever it's called in Mac-land), you can type "pwd" for "print working directory". it will tell you what folder you are currently in. if you have a directory like :
and your PWD says you are in SubDir1, then the relative path would be "go up one level, then go down to SubDir2, Down to SubSubDir1, and then find Party.Java". in linux speak, that would be "..\SubDir2\SubSubDir1\Party.java"
The Full path would be "\TopDir\SubDir2\SubSubDir1\Party.java". The full path will always work, no matter what directory you are in, but the relative path changes depending on where you are.
Hope that helps a little...
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Tim Holloway wrote:using backslashes in file paths is a sure indication of Windows infection.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
I would suggest exploring the OS command shell before diving into programming. Programmers are typically considered as power users who can command systems to do their tasks.ada eze wrote: thanks for replying. Please explain how i can "provide a full or relative path to the file". I'm a complete newbie with no experience.
...
please provide a step by step guide.
Is that the Party class from the early pages of Head First Java by Sierra and Bates? The book doesn't explain very well that Party is incomplete and its code cannot be run as it stands.fred rosenberger wrote:. . . "Party.java"? . . .
Tim Holloway wrote:
Is MacOS that old? Things changed a lot over the last 2 decades in the Macintosh world.
Consider Paul's rocket mass heater. |