Hello World in Java (Windows)

This document instructs you on how to set up a Java programming environment for your Windows Windows logo computer. It also provides a step-by-step guide for creating and compiling a Java program in IntelliJ and executing it from the command line.

You will need a 64-bit version of Windows Vista, 7, 8, or 10.

    0.   Install the Java Programming Environment

The installer installs and configures a Java programming environment, including OpenJDK 10 and IntelliJ IDEA Community Edition 2018.2.

    1.   Open a Project in IntelliJ

You will develop your Java programs in an application called IntelliJ IDEA Community Edition.

IntelliJ organizes Java programs into projects. In our context, each project corresponds to one programming assignment. A typical project contains Java programs, associated data files, and course-specific settings (such as compiler options and style rules).

    2.   Create a Program in IntelliJ

Now you are ready to write your first Java program. IntelliJ features many specialized programming tools including line numbering, syntax highlighting, bracket matching, auto indenting, auto formatting, auto importing, variable renaming, and continuous code inspection.

    3.   Compile and Execute the Program (from IntelliJ)

Now, it is time to execute (or run) your program. This is the exciting part, where your computer follows the instructions specified by your program. Before doing so, you must compile your program into a form more amenable for execution on a computer.


Use the Tools menu to compile and execute your program from IntelliJ. The Build and Run menus support additional options (such as a debugger) for advanced programmers.

Also be sure that the main editor window is active before using the Tools menu (e.g., by clicking the code you want to compile or execute).

    4.   Compile and Execute the Program (from the command line)

The command line is a simple and powerful mechanism for controlling your programs. It supports features that are unavailable in IntelliJ, including file redirection and piping.

    5.   Textbook Libraries (from the command line)

To make our textbook libraries accessible to Java from the command line, you will use our wrapper scripts.