Learn now! How to develop the first Java program and the first java program

Source: Internet
Author: User

Learn now! How to develop the first Java program and the first java program

Today, our goal is to develop the first Java program in our life. Although IT may be very simple, this small step is a huge step into the IT industry! Next, let's take a closer look at the development process.

  • Preparations

1. As a quasi-programmer, it is essential to bring your own computer. As for configuration, as long as it is not a "Overlord" learning machine.

2. Create the following folder on your computer:

D: \ java \ jdk: store the Java environment

D: \ java \ tool stores other development tools

D: \ java \ code stores Java programs

D: \ java \ doc stores other documents

Note: The above directory is just a reference. The purpose is to make everyone develop good habits and do not store our materials at will. Otherwise, if there are more things, you will not know where to store them.

 

  • Install the Java Development Environment

Installing the Java development environment is actually to install a software, which can be completed smoothly as prompted, which is very simple.

1. Download the JDK software.

2. Install

Double-click the JDK Executable File

 

 

 

Then, complete the installation in the next step.

3. Configure Environment Variables

Right-click my computer and choose "properties"> "advanced"> "environment variables". The following page is displayed:

 

Now, the environment is ready!

 

  • Develop the first program

1. Create a text document under the D: \ java \ code directory and change the file name to Hello. java.

2. Right-click the Hello. java file and choose to open it with notepad.

3. Write the following code in the file and save it:

 

4. Prepare to run and start our program

 

Enter the Windows + R key simultaneously on the keyboard. The following page is displayed, and then enter cmd.-OK.

 

Enter D: And press Enter.

 

Enter cd D: \ java \ code and press ENTER

 

Enter javac Hello. java and press enter (note that the letters are case-insensitive)

 

Enter java Hello and press Enter.

 

Okay. After the program is running, we printed a sentence to us on the console.

 

Through this study, we will know that programming is actually not difficult. It is good to accumulate installation steps a little bit. This article only tells you how to write something. Why do you write something like this? We will share this with you in the next issue.

Followed:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.