Create a notepad document enter the following code:
public class Welcome{
public static void main(String[] arge){
System.out.println("hello world!");
}
}
The case must be consistent when you save a file
To prevent the error will Hide extensions for known file types to remove the hook
type cmd in the Start menu, open the command prompt, enter the folder where the disk
enter DOS command "cd folder name" into the folder
Javac compile this file, create bytecode files
Possible errors:
1. error: Javac is not an internal command or external command
reason: path variable configuration errors Javac command not found
Solution: Reconfigure variable path environment variable configuration tutorial
2. Follow the prompts to prompt code to view the code wrong went wrong
(note symbol English sign, because a lot of mistakes when entering the code using Chinese symbols)
If it shows no error and compiled a .class file appears
you write code compile successfully in the command prompt, enter "Java file name" will run out