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:
- Go to the Control Panel (under Settings from the Start Menu).
- Open System.
- Select the "Advanced" tab, and then "Environment Variables".
- Look for
"Path" in the User Variables.
- Choose to Edit this.
- 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.
- 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.