Java: Troubleshooting

(by Scott McElfresh  August 2006, based on earlier documents and a documents at java.sun.com)
(modified on September 1, 2006)

Class Path

<>If you get the error: "javac is not a recognizable command".  You likely need to set your classpath.  Occassionally, something goes wrong during installation that is not discovered until you first try to compile or run your program.    This should only be an issue on PCs.  Macs should be just fine.

To fix this, you can set the PATH variable by:

  1. Go to the Control Panel  (under Settings from the Start Menu).
  2. Open System.
  3. Select the "Advanced" tab, and then "Environment Variables".
  4. Look for "Path" in the User Variables.
  5. Choose to Edit this.
  6. AFTER whatever is there, add a semicolon (;) followed by (with no space):  C:\Program Files\Java\jdk1.5.0_08\bin    Note that you may need to modify this to be the name of an actual folder on your c drive.  Look at the contents of your C drive to find the exact name of your folder.  
  7. Click "Set", "OK" or "Apply".


Directory Navigation

If you get the error:  error: cannot read: kareltherobot/Application.java,   then you are likely in the wrong directory.  Be certain that you are in the exercise folder, but NOT the kareltherobot folder.   Java needs to be able to see the entire exercise folder.

Still having problems?

Contact Scott or the Course Assistants.