Session 1 |
Install Java and IntelliJ
In this course, we are going to use JDK and IntelliJ.
First of all, read the following terms and their explanations.
Java has several editions. Some of them are:
- Java ME - Java Micro Edition - to develop applications for mobile devices, such as cell phones.
- Java EE - Java Enterprise Edition - to develop server-side applications, such as Java servlets, JavaServer Pages (JSP), and JavaServer Faces (JSF).
- Java SE - Java Standard Edition - to develop client-side applications. The applications can run standalone or as applets running from a Web browser. We will use this edition! There are many versions of Java SE. The latest one is Java SE 11. Oracle releases each version with a Java Development Toolkit (JDK).
JDK - Java(TM) Development Kit - a software development environment for writing applets and application in Java. It includes JRE (Java Runtime Environment), compilers and various tools like JavaDoc, Java debugger etc. In order to create, compile and run Java program you would need JDK installed on your computer. PS: Java SE 11 edition needs the JDK called Java 11 or JDK 11.
JVM | JVM - Java(TM) virtual machine (JVM) - a software "execution engine" that safely and compatibly executes the byte codes in Java class files on a microprocessor (whether in a computer or in another electronic device). |
IDE - integrated development environment - a Java development tool (e.g., IntelliJ, Eclipse, NetBeans, TextPad etc) that provides an integrated development environment for developing Java programs quickly. Editing, compiling, building, debugging, and online help are integrated into one graphical user interface. We simply enter source code in one window or open an existing file in a window, and then click a button or menu item or press a function key to compile and run the program. IDE can be used instead of the JDK.
API - Java library that contains predefined classes and interfaces for developing Java programs (API is continuously expanding). Check the documentation here.
Useful link: Watch the video in youtube if you need the subtitles.
Step 1. Install Java development kit (JDK)
(If you already have JDK 11 installed, go directly to step 2.)
- Go to Java downloads webpage: here.
- Accept the licence.
- Select the most recent version of JDK “Java SE Development Kit 11.0.2” and a suitable version for your computer.
- Download and install:
- In Windows the installation proceeds similarly as installations of any Windows program.
- In Mac OS X 10.8+, the installation resembles installation of any dmg-package. If you need help, look here.
- In most Linux distibutions, get JDK directly from the packet management. In Debian based distributions (eg. in Ubuntu), it is enought to install the package openjdk-11-jdk which can be done in command line with the command
sudo apt install openjdk-11-jdk -y
or by using the Synaptic Package Manager. In the case that your distribution does not provide a suitable JDK, you can do the installation by extracting the .tar.gz-file found on the Oracle page.
Useful link: How to Install JDK 11 (on Windows, Mac OS & Ubuntu)
Step 2. Install IntelliJ IDEA
There are many different editors that you can use to write your Java code. In this course, we will use IntelliJ IDEA - a Java integrated development environment for developing computer software.
Download the Community version and install the program according to your operating system:
- Windows: the installation is done by opening the downloaded executable file.
- Mac OS X: the installation is done the same way as any .dmg package. Move the IDEA app inside the downloaded package to your Applications folder.
- Linux: the installation is done by executing the installation script via the command
./bin/idea.sh
in the directory where the file is located. The script can be executed only if it has been given right permissions eg. withcommand chmod +x bin/idea.sh
.
Useful link: Check the hotkey combinations here.
Session 1 |