1) Download
JDK can download free download in the Sun website http://java.sun.com, currently the highest version is J2SDK-1_4_2_07 download installation JDK (assuming the installed directory is c: /java/j2sdk1.4.2_07) 2) Set the environment variable Take WinXP as an example: Right-click "My Computer" -> "Properties" -> "Advanced" -> Pop-up "Environment Variable" dialog box in the "System Variable" column Select Path, click Edit, " The tail of the variable value "After the end of the text box"; c: /java/j2sdk1.4.2_07/bin "(Note the semicolon before the drive letter) and then" New ": Variable Name:" ClassPath "variable:" After determining, restart your computer 3) Run the Java program in the Notepad public class hellojava {public static void main (string args []) {// will Hello Java! ! Output to System.out.println ("Hello Java !!") ("Hello Java !!") ("Hello Java !!");}} To Hellojava.java, such as c: /demo/hellojava.java enters the DOS command line (click "Run" input cmd) Javac C: /Demo/hellojava.java enters C: / Demo directory Java Hellojava if "Hellojava !!" is displayed normally
Attachment: Java Compile: JavaC.exe syntax for: Javac [Option] Source Program File Name Java Interpretation: Java.exe Syntax is: Java [Options] Classified Applet Browser: AppletViewer.exe Applet Browser is used to run Java Applet Program Syntax: AppletViewer [Option] URLS (or .html File) Java Anti-Compiler: JavaP.exe Java Anti-compiler is used to display the compile-compiled byte code syntax: JAVAP [Option] Class C header file founder: Javah. EXE is used to create a C language header file syntax when you need to use C language to extend Java code: Javah [option] Class name Java Document generated tool JavaDoc.exe is used to generate a logo-based HTML file Java debugger in the Java source file: JDB. Exe Java Environmental Commissioning Tool