1. Setting of environment variables
(1) Open "Computer" → "System Properties" → "Advanced System Properties" → "Environment variables";
(2) NEW:java_home: JDK installation path (e.g.,C:\Tools\Java\jdk1.7.0_51);
(3) Path: add %java_home%\bin;;
(4) Press the ALT key to display the toolbar, click "Tools" → "Folder Options" → "view" → Remove the "hide extensions of known file types" in front of the check box, so that the file suffix name can be displayed;
(5) Windows logo key, hereafter referred to as win key;
(6) Press and hold win+r at the same time, input cmd, enter the DOS command line interface;
(7) In the DOS interface input java,javac,java-version,javac-veriosn are tested successfully, wherein java-version ,javac-veriosn pop-up interface such as:
2. Writing Helloworld.java files
(1) Create a new text document and enter the following code
Class helloworld{2 void main (string[] args) {3 System.out.println ("helloworld! I love Java" ); }5}
(2) Save to D disk D:\Java\00Base\01day folder, file name is Helloworld.java, save type " All Files ", encoded as ANSI ;
(3) switch to the folder where Helloworld.java is saved (for example,D:\Java\00Base\01day);
①d: yes switch to D drive;
②cd D:\Java\00Base\01day is the switch to D:\Java\00Base\01day folder;
③javac helloworld.java compile helloworld.class file;
④Java HelloWorld run the helloworld.class file.
(4) Write Java code using advanced Notepad notepad++.
notepad++ download Link: notepad++ Download password: DirY
Setting and HelloWorld of Java environment variables in 00003_win7