CHAPTER 2Getting Started with Java Programming

“If a craftsman wants to do good work, he must first sharpen his tools.”

—Ancient Chinese proverb

2.1 Downloading and Installing Java

Let's get started with Java programming. First, you will need to download the latest Java software from the Oracle web site, as shown in Figure 2.1 (www.oracle.com/technetwork/java/javase/downloads/index.html). There are three download choices: JDK, Server JRE, and JRE. The server JRE and JRE are for running the Java programs only; since you will need to compile Java programs in this book, you need to download the JDK software package. Just follow the instructions on the web site to download and install the Java SE JDK on your computer.

Image described by caption and surrounding text.

Figure 2.1: The Java SE download web site

After installation, you will need to set up a few environmental variables, such as PATH and JAVA_HOME. Environment variables help programs know which folder to install files in, where to store temporary files, where to find user profile settings, and so on. To set up the environmental variables in Windows, go to Control Panel ➪ Advanced System Settings ➪ Environment Variables. ...

Get Practical Java Programming for IoT, AI, and Blockchain now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.