IntelliJ idea to run your first Java application

Source: Internet
Author: User

IntelliJ idea to run your first Java application
Create a project let's create a simple Java Hello World project.

Click Create a new project.

Open the New Project Wizard.
The main item you should pay attention to is the SDK. The SDK (software Development Kit) is a set of software development tools that allow you to develop applications faster. IntelliJ idea does not include the SDK, so if you have not, download and install it. Because we do a Java project, we need a Java SDK (JDK).

When the installation is complete, click New to point to the installation folder for the JDK.

In the New Project Wizard, you can choose the technology supported by your project, but you are doing a normal Java application and do not need to select them, just click Next. The IDE then provides you with the creation of a project from a template. We don't need this now, so click Next.
Specifies the name and location of the project. Click Done.
You have the SRC folder in the project. This is the folder of your source code. Right-click the folder and select New | Java class.
Enter the name of this class "QuickStart. HelloWorld ", and click OK.

Now, the new class opens in the editor. Please note that this HelloWorld class is created in the QuickStart package. The text of the HelloWorld program is known

    1. Package QuickStart;
    2. public class HelloWorld {
    3. Public static void main(string[] args) {
    4. System.out.println ("Hello, world!");
    5. }
    6. }

Insert it into the class.


When you run an application, you need to have a configuration, and the process is basic. To create a run configuration, click Run | Edit the configuration, then click, and then select Apply.
Here, you can specify the main class and program parameters. Because we have a simple application, we just need to point out the main class. Put QuickStart. HelloWorld to the main class text field. Print something in the Name field, for example: HelloWorld. The run configuration is ready.
Now you can run your application immediately and make sure all works fine. Select Run | Run ' HelloWorld ' from the main menu.
Get results in the lower left corner of the window!

To debug the application, select Run | Debugging.
You also edit the configuration for this. To learn more, see Run/debug configurations: Apps.
You can set a breakpoint by clicking the left mouse button in the position of the page arrow before the line of code.

IntelliJ idea to run your first Java application

Related Article

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.