1. Install JDK, I installed JDK1.5.0
2. Set the environment variable set path = d: / program files / java / jdk1.5.0 / binset classpath = d: / program files / java / jre1.5.0 / lib / rt.jar;
Before running the above command, you should run the SET or SET PATH to see the currently set environment variables to set environment variables for multiple programs, such as: SET PATH = D: / Program Files / Java / JDK1.5.0 / bin; C: / Oracle / ORA90 / BIN
You can also do not set an environment variable, but when compiling the Java program, you must enter the bin directory to run the compile command, such as CD D: / Program Files / Java / JDK1.5.0 / Binjavac HelloWord.Javajava HelloWord
3. Enter the Java file where javac d: / e_t / java / test compiles Javac HelloWord.java, generate helpoWord.class files run Java HelloWord
Attached to HelloWord.java program //---------helloword.java---------public class helloword {public static void main (string [] args) {system.out.println ("Hello World");}} 4. Applet
// ----------- helloWorldapplet.javaimport java.awt. *; Import java.applet. *; Public class helloworldapplet outs applet {public void Paint (GRAPHICS G) {g.drawstring ("Hello World ! ", 20, 20);}}
// ------------ HelloWorldapplet.htm