Notepad to write hello word

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
Here Insert Picture Description

To prevent the error will Hide extensions for known file types to remove the hook Here Insert Picture Description
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)
Here Insert Picture Description

If it shows no error and compiled a .class file appears Here Insert Picture Description
you write code compile successfully in the command prompt, enter "Java file name" will run out
Here Insert Picture Description

Released seven original articles · won praise 12 · views 204

Guess you like

Origin blog.csdn.net/lu_lu_n/article/details/104443518