Do HelloWorld in Java / IntelliJ / Gradle

environment

Create a Project

In File> New> Project, select Gradle / Java and press Next. 01.png

Enter any name in Name. (ef.SpringBootSample) Set the GroupId and ArtifactId. (This time is the default) Finally, press Finish to create the Project. 02.png

Do HelloWorld

Right-click on the root project in the Project pane on the left From New> Directory, select src> main> java and press Enter to create the folder. 03.png

Right-click the created java folder and select New> Package. Type org.example and press Enter. 04.png

Furthermore, right-click the example folder and select New> Class. With Class selected, type Main and press Enter. 06.png

Describe the following in the created class.

Main.java


package org.example;

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello World");
    }
}

Execute Main.main ().

4:33:31: Executing task 'Main.main()'...

> Task :compileJava
> Task :processResources NO-SOURCE
> Task :classes

> Task :Main.main()
Hello World

You can now write Java code in IntelliJ.

Recommended Posts

Do HelloWorld in Java / IntelliJ / Gradle
Do Scala Option.or Null in Java
[Java] Do not use "+" in append!
Java + OpenCV 3.X in IntelliJ IDEA
Do you use Stream in Java?
Hello world in Java and Gradle
In Java 10, when you do gradle eclipse and JavaSE-1.10 comes out, ...
How to create a new Gradle + Java + Jar project in Intellij 2016.03
How to do base conversion in Java
Optimize Java import declarations in IntelliJ IDEA
Create Java Spring Boot project in IntelliJ
Do not accept System.in in gradle run
Do TensorFlow in Java. It's easy, though. .. .. ..
Do not declare variables in List in Java
Creating a project (and GitHub repository) using Java and Gradle in IntelliJ IDEA
Partization in Java
Changes in Java 11
Rock-paper-scissors in Java
Pi in Java
FizzBuzz in Java
[Gradle] Build operations often performed in Java projects
Static code analysis with Checkstyle in Java + Gradle
Resolve "Cannot resolve symbol" in IntelliJ projects using Gradle
Java tips-Create a Spring Boot project in Gradle
What to do when you think you can't do Groovy-> Java in IntelliJ IDEA CE
[java] sort in list
Read JSON in Java
Interpreter implementation in Java
Make Blackjack in Java
Rock-paper-scissors app in Java
Constraint programming in Java
Put java8 in centos7
I want to do something like "cls" in Java
NVL-ish guy in Java
Combine arrays in Java
[Gradle] Generate Javadoc including JavaScript in Java 1.8.0_121 or later
Callable Interface in Java
Comments in Java source
Do not write if (isAdmin == true) code in Java
Azure functions in java
IntelliJ installation + HelloWorld (mac)
Format XML in Java
Simple htmlspecialchars in Java
First gradle build (Java)
Boyer-Moore implementation in Java
Hello World in Java
Use OpenCV in Java
webApi memorandum in java
Type determination in Java
Ping commands in Java
Various threads in java
Heapsort implementation (in java)
Zabbix API in Java
ASCII art in Java
Compare Lists in Java
POST JSON in Java
Express failure in Java
Jigsaw notes in Gradle
Create JSON in Java
Date manipulation in Java 8
What's new in Java 8