Before you can use GeoServer on your machine, you need to install some required pieces of software. GeoServer is a Java application; therefore, one of the most important things you need to ensure is that a Java virtual machine is working on your machine.
There are two main packages of Java. Depending on what you are planning to do with Java, you may want to install a JDK (Java Development Kit) or JRE (Java Runtime Environment).
The former enables you to compile Java code, while the latter has all you need to run most Java applications. Starting from release 2.0, GeoServer does not need a full JDK installation, and you can go safely with JRE. The JDK is only required if you are planning to write and compile Java code. This is the case if you want to modify the GeoServer source code, to fix code, or add functionalities.