wood burning stoves 2.0
The moose likes Beginning Java and the fly likes Head First GoodDog code error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Head First GoodDog code error" Watch "Head First GoodDog code error" New topic

Head First GoodDog code error

Dustin Eldridge

Joined: Feb 04, 2008
Posts: 20
When I try to run this code from the book I get this error.

Here is my code

Here is the error

javac is not recogizable as an internal or external command, operable program or batch file.

funny I have compiled files from this same dir and computer just yesterday so I know the path is correct.

Walter Gabrielsen Iii
Ranch Hand

Joined: Apr 09, 2011
Posts: 158
Have you updated your Java version recently?

Java update can create new folders in the Java program directory for new versions. Such as "jdk1.6.0_25" folder inside the "Java" program folder.

Check in your system properties that your "path" and "classpath" variables, and the Java directory are pointing to the same folder.
Dustin Eldridge

Joined: Feb 04, 2008
Posts: 20
Well the funny part is I used javac on a old java file that I have already compiled and it worked today. So then I tried it on the GoodDog.java file and it came back with some errors in the code but it is working now. Dont have a clue what happened Friday because I have not changed anything. Oh well, thanks for your help.

Dustin Eldridge

Joined: Feb 04, 2008
Posts: 20
Does this GoodDog code from HFJ book on page 82 really work?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15092

The code above won't compile because you forgot a " quote on line 17.

The error you had earlier ("javac is not recognized ...") doesn't have anything to do with the code. It just means that the operating system can't find the Java compiler, because your PATH environment variable isn't set up correctly.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link: http://aspose.com/file-tools
subject: Head First GoodDog code error
It's not a secret anymore!