It sort of depends on what you were doing when you got the message, doesn't it? If it really is JavaScript that you're trying to learn, you need to run that from a browser. If it's Java, then read on.
If "access denied" happens during the javac compile, your environment may not be set up right. Try:
javac -version
...at the command line. If that gives a nice normal response, like:
javac 1.6.0_26
...then you are probably good on that count. Next, try:
type MyJavaClass.java
...replacing "MyJavaClass" with your program's class name, which should match the source file name exactly, including captialization. If that fails, then your source file is not readable. Make sure that it's not open in some strange editor (most text editors don't lock out source files) and try deleting and recreating the file, making sure you create it on the same login that you intend to use to compile and run.
Here's a console session to try:
- - - - - tear here - - - - - -
C:\User\Husoski>javac -version
javac 1.6.0_26
C:\User\Husoski>copy con Sneeze.java
public class Sneeze {
public static void main(String args[]) {
System.out.println("Achoo!");
}
}
^Z
1 file(s) copied.
C:\User\Husoski>javac Sneeze.java
C:\User\Husoski>java Sneeze
Achoo!
C:\User\Husoski>dir Sneeze.*
Volume in drive C has no label.
Volume Serial Number is A42B-08C8
Directory of C:\User\Husoski
09/19/11 06:38 PM 412 Sneeze.class
09/19/11 06:38 PM 102 Sneeze.java
2 File(s) 514 bytes
0 Dir(s) 9,576,185,856 bytes free
C:\User\Husoski>
- - - - - tear here - - - - - -
If you can repeat that, you have a working JDK and can start looking at what's wrong with your Hello World program. (Note: The ^Z at the end of the source program means to type Ctrl+Z, followed by Enter. The command prompt will display "^Z" and close the console input to the copy command. That command is simply copying directly from the console (the "con" device) to a file named Sneeze.java in the current directory.)