Do you want to learn Java programming?
Then this tutorial is for you.
I’ll show you how you can learn to programme with Java without any previous programming knowledge.
Let’s get started!
Goal: We develop a Java software
Today you are building a Java application that can welcome you, and we are starting from absolutely 0.
The tutorial gives you an introduction to developing an app based on Java.
Why should I learn Java?
Java has been one of the top programming languages in IT for 25 years. With Java, you can..
- Android apps with Android Studio
- Windows and Mac programmes (JavaFX, Java Swing)
- Server programmes such as Spring (backend)
- Websites – JavaServerPages (frontend)
… create.
Many companies use Java Apps for their business processes, applications and apps and pay their developers well!
Do I need prior knowledge for the guide?
No!
This tutorial is intended to be a beginner’s course for beginners with no programming experience. I don’t want to torture you with binary numbers or irrelevant theory, but rather motivate you for Java.
We will concentrate on understanding the programming lines that I will show you.
Do I need a better computer?
No!
In contrast to gaming and image editing, you can use almost any old donkey of a computer for programming.
You can choose development environments that consume masses of labour. The programmes are often confusing and unsuitable for beginners!
How long do I need to learn Java?
The 20-hour rule states that you can master the basics of any activity in 20 hours.
Programming follows a similar pattern. After 20 hours you should be able to write simple programmes. After 20 hours you will not normally be able to build complex systems with design patterns, best practices and optimisations.
Prerequisites: Your knowledge
- No programming knowledge
- Admin rights to install and uninstall programmes
Concept: Java basics
A few basics at the beginning will give you an idea of Java programming.
What is Java?
Java is a platform-independent programming language from Oracle, designed by James Gosling. You can run platform-independent software based on Java on all operating systems:
- Windows
- macOS
- Linux
- Chips / microcontrollers
- Servers
- Smartphones
- …
You program 1x and port the programme to other computers in the form of a jar or war file. The only requirement is the Java execution environment, which is installed on 3 billion computers worldwide.
Normally you would have to develop a separate programme for each operating system – new syntax, new concept, new memory structures!
Java saves time and money!
Your development environment
For programming, we need a so-called development environment.
You can choose between many different development environments on the market. I’ll show you how to make the VSCodium development environment Java-ready. Every Integrated Development Environment (IDE) has its advantages and disadvantages. You can extend a development environment and customise it to suit your needs.
Basics: Programming basics
What is programming? How does it work? A few basics before the tutorial!
How does programming work?
The computer can only calculate and memorise 0s and 1s. The computer is stupid.
Very stupid.
As a clever programmer, you tell the computer what to do. When programming, you create a list of commands that the computer executes one after the other.
What is a programme?
A programme that you have programmed is executed by the computer like a recipe each time it is run. The programme has run successfully when the computer has successfully executed the last command.
The instruction
System.out.println(“Hello world”);
tells the computer that the screen should display the words “Hello World”.
Your programming toolbox
A list of commands is not enough for flexible programming – most programming languages offer you options such as repeating code (loops) or calling subroutines (functions) to save you a lot of typing.
Saving data in variables
For programming, you use values that are stored in variables:
- Character strings / words “
Good morning"
= String - Integers
1,2,3,4
= Integer - Truth values
true / false
= Boolean
Your Java programme takes the input values, calculates or transforms them so that a result is produced at the end.
Most programmes do nothing other than load and display documents, videos, images, texts or numbers so that the user can change them(CRUD). Finally, many programmes save the results in persistent memory.
If you need more details on the basic idea of programming, read the complete beginner’s guide.
Coding: Off to practice
I hope you have understood the basics of programming. Let’s get into practice!
Installing the environment
Firstly, we need Java for your computer. The Java Runtime Environment (JRE) is not enough, we need the Java Development Kit (JDK)!
- Download the MSI of Java 17 for Windows as MSI (200 MB) https://adoptium.net/
- Open the MSI

- Click through the programme until “Custom Installation” appears and select the following fields:
- Give the programme time to install.
- Search or check the term
environment variables
via the Windows search and change the environment variable path for the variable JAVA_HOME in the system and for the user to:C:\Program Files\ojdkbuild\java-1X-openjdk-XXXXXXX

- Go to the website https://vscodium.com/ and download the Windows installation.
- Execute the file and install VS Code.
- Go to the tab Extension (4 squares on the left side) and search for the
extension Language Support for Java(TM) by Red Hat
with the search above the extension list.

- Install the extension and restart VS Code!
- Restart the computer
Your first project: Hello World
- After restarting Java, create a file in VS Code
File > New
- Press
Ctrl S
and save the empty file with the nameHelloWord.java
on your computer

- Enter the following lines of code
- Pay attention to upper and lower case, indentation and the correct use and type of brackets:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}

Click on the text “Run” above the public static void main
, which automatically generates VS Code. In the console below you will now see:

Explanation of the Hello World code
You create the Java classes with the keyword class
and the name Hello World
. Everything that belongs to a class is placed in the curly brackets below it.
The developer uses the keyword public
to describe classes (and functions) that are publicly visible.
The main function is called main
. The computer executes this when the Java programme is started:
public
– describes the visibility of the functionstatic
– says that the function can be called from outside without the programmer having to have created the class.void
– indicates that the function does not return anything (for further processing).main
– is the name of the function.(String[] args)
– are the input parameters. Here the Java programme takes a number of start values that a user can enter via the command line when starting the programme. We do not use these for our programme.
Before I continue with the code, you should have understood the most important basic concepts of computers and programming.
Extensions: How can I extend the app?
Haven’t you had enough of the Java tutorial?
Or would you like to get to know Java better?
Then I’ll show you in this section how you can expand your app and your knowledge.
Change your programme as follows. (Explanation below)
public class HelloWorld {
static String name = "Steffen";
static Integer age = 21;
static Boolean adult = true;
public static void main(String[] args) {
sayHello();
System.out.println(isHeAdult());
}
public static void sayHello(){
System.out.println("Hello " name);
}
public static String isHeAdult(){
String result = "";
if(age >= 18){
result = "Yes";
} else {
result = "No";
}
return result;
}
}

Explanation of the code
In the first section of the class, we define a static variable (static).
- The
main function
calls two other functions that are executed when the main is executed. - The first function is static and only says “Hello Steffen”.
- Unlike the other functions, the second static function returns a string when called.
- The print statement
System.out.println()
displays the return value of the function in the console. - The second function uses the
return
statement for the return, which sends a local variableresult
to theSystem.out.println()
command. - The second function uses an
if branch
(not a loop), with a condition that checks whether the specified age is an adult age(18
and up). The first part of theif-branch
defines the positive case and the second case if the age is below the number18
.
Conclusion: Congratulations on your Java app
Be creative. Read the Java documentation. Test Java.
I look forward to your comments with the link to your (first) Java project.
- Write about errors that occur …
- Text passages that were described unclearly
- Criticism with suggestions for improvement…
- Suggestions for new posts …
- Installation problems …
Thank you. I look forward to your feedback!