Troubleshooting the Environment: FAQ
- What if the JDK is already installed in my computer?
If your JDK is 1.6 or later then you can skip the JDK download and install step. Otherwise,
remove the your old JDK (using Add / Remove Programs in the Control Panel) before
installing a new one.
- I keep getting
is not recognized as ... in the console!
Your path is not set properly. Issue the path command by itself without
any arguments. When you press ENTER it displays its current setting. Examine the part
that refers to the JDK and ensures it indeed points to where your JDK is installed.
- I get
NoClassDefFoundError when I attempt to run my program!
First make sure your class file (e.g. Prog.class is indeed present in the working directory.
If so, try running it using the command: java -cp . Prog. If this worked then your
classpath environment variable is not set properly (perhaps some other program set it
incorrectly). Locate this variable in the Control Panel (like under System, Advanced), edit it, and
prefix it with .; (dot, semicolon).
- I get
UnsupportedClassVersionError when I attempt to run my program!
This occurs when you have an older JRE in your system. To fix it, edit your path variable and make
sure the part in it that refers to your JDK appears first; i.e. it starts with the path to your JDK.
-
-
-
-
-
-
-