It sounds like there is a problem with the CLASSPATH on your computer. The classpath tells the compiler where to find the java files you are trying to use. Usually this is set to at least ".", which means "look in this directory". The installer should set this up, but often doesn't.
We'll go through how to set this up now.
If you are in Windows 7, search 'settings' for 'Control Panel' and open it. If you are on another Windows system, go to 'Start Menu' -> 'Settings' -> 'Control Panel'.
Find 'System' in the Control Panel area.
Go to the 'Advanced' tab at the top.
Click the 'Environment Variables' button.
Environment variables are a set of variables most operating systems
have that control lots of things that are specific to your
computer - for example, where to store temporary files. We're interested
in the CLASSPATH
which tells the
Java Virtual Machine where to look for java files to run.
Under 'System Variables' scroll down to CLASSPATH
. If you
can't find it, you'll need to create it using the 'New' button. If you
can find it, push the 'Edit' button.
The CLASSPATH is made up of directory lists, separated (in Windows) by semi-colons ';'. Even if you just have one directory, it needs to end with a semi-colon. Add '.;' to the front of your CLASSPATH, if it isn't there already. This will make sure the JVM checks the directory you are running java in first for files to compile and run. Save the changes.
Save it, and 'OK' out of the Control Panel. Close your current command prompt window and re-open it (you MUST do this for the changes to be picked up). Navigate back to the Test.java file, try the following again, making sure you get exactly the right capitalisation (java is case-sensitive):
javac Test.java
If this works, you should see a blank line come back. Is this what you see?