CodeGym /Courses /Java Syntax /The simplest program

The simplest program

Java Syntax
Level 3 , Lesson 1
Available

"Hi, Diego!"

"Hi, Amigo!"

"The professor praised me recently. He was glad that I'm making such fast progress thanks to his lessons."

"You're making progress thanks to the professor's lessons?! Oh, sure! Doesn't he realize how funny that is?"

"Well, never mind. I have something interesting for you today. I'll teach you how to write the simplest (or minimal) program. It's very easy. A minimal program consists of one class and contains one method - main(). This is how it looks."

The simplest program
public class MainClass
{
    public static void main(String[] args)
    {
        System.out.println("Kiss my shiny metal rear actuator!");
    }
}

"I've seen that before, so I get it."

"Of course, nobody needs programs like that. The more complicated the problem solved by a program, the cooler the program is. That's why programs normally consist of thousands of classes."

"An average program is written by a team of ten people over 2-3 years."

"What would be considered a big program, then?"

"Maybe a program that takes a team of 100 people 5 years to write."

"500+ human-years? Oh, wow!"

"Yes. Java is one of the best programming languages for writing big and very big programs."

"I'm scared to ask what constitutes a 'very big' program."

"Good for you! You catch on fast."

"Programmers quickly realized that it's difficult to navigate through thousands of classes. They came up with special programs that accelerate the process of writing programs manifold. The bigger the program you're writing, the clearer the benefits."

"So programmers came up with a program for writing programs?"

"Yes. Why are you surprised? A program is above all a tool for automating routine tasks. When you've written code for a couple of years, you'll find there are a huge number of such tasks."

"A program for creating programs is called an Integrated Development Environment (IDE).

Today, you'll see one of them.

No, today you'll see the best of them! It's called IntelliJ IDEA, and it will become your faithful friend for many years ahead. It's like a more experienced companion who always provides hints and help."

"Now that's intriguing!"

"If you aren't going to write programs in Word, then you'll need a good development environment, right? We robots prefer the IntelliJ IDEA Community Edition. Download and install the latest version."

Hint 1
How to find IntelliJ IDEA on Google

Hint 2
Download page for IntelliJ IDEA

Hint 3

Please, install Open JDK before creating a new project in Intellij IDEA

"You'll also have to install a Java development kit (JDK). A JDK is a kit for Java developers, created by the founders of the Java platform. It includes a Java virtual machine, Java compiler, and much more that an experienced Java developer might need."

"What's wrong with how I've been writing programs – through the website?"

"That's convenient for small programs, but it's better to write big ones in IntelliJ IDEA. We're preparing you to become a professional programmer, so the faster you master these cool tools, the better. Don't be afraid. This program was created to make your life easier, not more difficult. You'll get used to it quickly. Soon you won't want to touch anything else."

"To learn how to write programs, you need to write programs. For that, install IntelliJ IDEA and a JDK on your computer. Download and install OpenJDK 16."

Hint 1
First of all, visit this page: https://jdk.java.net/16/

It should look something like this: open JDK

In the Builds section, click on the version for your OS in order to start the download process.

Unpack the downloaded archive. We suggest you save the unpacked project folder to a safe destination, to avoid accidental removal.

"Let's reinforce the theory with an exercise."

In case you face any issues with the JDK installation, do not hesitate to contact our support team by e-mail support@codegym.cc or using chat widget in the lower right corner of the page.

Comments (170)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Lishon Level 3, Nottingham , United Kingdom
11 July 2023
I keep overthinking.
qaz_gangnam Level 16, Korea, Republic of
3 May 2023
Is Amazon Corretto ok too?
KrisP Level 4, Barcelona, Spain
5 January 2023
Right! IntelliJ IDEA already installed.
Lunita Level 4, Dominican Republic
2 January 2023
Good. I already have IntelliJ IDEA in my computer.
Minh Hoàng Nguyễn Level 10, Hanoi, Vietnam
28 November 2022
How about JDK 18?
Angel Level 3, Spain
9 July 2022
Hi, I’m having trouble installing the Java development kit https://download.java.net/java/GA/jdk18/43f95e8614114aeaa8e8a5fcf20a682d/36/GPL/openjdk-18_windows-x64_bin.zip.sha256 I get this message when visiting the link a5b91d4c12752d44aa75df70ae3e2311287b3e60c288b07dade106376c688277
Aleksa Level 18, Belgrade, Serbia
15 March 2022
How do i solve this in the IDE ?
Steve C. Ands Level 10, Medellín, Colombia
18 November 2021
Ya tengo eclipse.
Víctor Alfonso Martínez Gómez Level 3, Manizales, Colombia
17 August 2021
The best is Visual Studio Code
Cleber Machado Level 4, São Luís, Brazil
7 October 2021
Ok Ok OK
Lunita Level 4, Dominican Republic
2 January 2023
Pero no es un IDE!
Aswin Anand Level 4, India
13 August 2021
i coudnt see jdk folder after installation
Regina Level 47, Florida, United States
17 August 2021
Please, contact our support team for further assistance.