1: Configure Java Environment variables first
New system environment variable
Name: Java_home
Content: D:\Program files\java\jdk1.7.0_13 is the folder location where your JDK is located
Modify Path Path
Add%java_home%/bin;%java_home%/jre after the path;
Verify that the environment variable is configured successfully:
Run cmd--java+ carriage return
Javac + ENTER
Java-version viewing version information for Java
After the environment variable succeeds, it will output Java main execution command information in the console.
2: For example:
Create a new folder under G-Disk
Create a new text Aa.java in a
1 class aa{2 Public Static void Main (string[] args) {3 System.out.println ("AAA"); 4 }5 };
3: In the Run window enter cmd+ carriage return
The first entry is the C drive,
Enter in the window: g:+ carriage return to G drive letter
Input: CD A + return to find a folder;
Input: Dir + ENTER to see the directory under the A folder, you can find the Aa.java file you wrote;
Input: Javac Aa.java compile Java file as Java executable class file
Input: Java AA execute Aa.class file
Success in the console to see the output of the information AAA;
Failed....
Command-line window compilation execution Java