If I type in:
javac D:\JavaTest\Hello.java
Here is what I get:
I'm a beginner in Java. I installed the Java SE Development Kit 6u22 from Sun's website.
I tried writing this code in Notepad:
class Hello {
public static void main (String[] args) {
System.out.println("Welcome to the world of Java Programming.");
} // method main
} // class Hello
I tried to compile it in a Command Prompt following these instructions.
To compile and run this program, you need to have installed JDK and added a line to your path statement referring to the directory of where it was install + \bin. (e.g. path %path%;c:\jdk\bin;
)
- Type this file into Notepad or a similar text editor
- Save it as Hello.java (class name + .java)
- Drop to a Command Prompt
- Type
javac Hello.java
(e.g.javac C:\work\Hello.java
) - Type
java Hello
(e.g.java C:\work\Hello
) - Watch the magic
I got an error message that 'javac' is not recognized as an external or internal command, operable program or batch file.
How can I fix this problem?