- Install the JDK (including JRE) from Oracle, OpenJDK or Temurin depending on your needs and system.
- Set JAVA_HOME and PATH so that the system can find Java and the compiler.
- Check out java/javac and use IDEs like IntelliJ or Eclipse to get started developing.
If you are going to develop or run Java applications, you need to have the environment properly installed and configured. In this complete guide, I explain how to prepare the Java Runtime and the JDK in Windows, Linux and macOS, with official methods and through package managers, how to adjust JAVA_HOME and how to check that everything works as it should.
In addition to covering the installation step by step, You will see the difference between JDK and JRE, version recommendations (Oracle, OpenJDK, Adoptium Eclipse Temurin), IDE configuration (IntelliJ, Eclipse, VS Code) and some useful details for academic environments, such as using Eclipse 2024-06 and UTF-8 encoding to avoid rare errors.
What are JDK and JRE, and what should you install?

The Java Development Kit includes the compiler, the JVM, and essential tools; When you install the JDK you also get the JRE, which is the runtime environment required to run Java applications. If you're developing, you need the JDK; if you're just running pre-compiled programs, the JRE is sufficient, but nowadays it's common to install the JDK directly.
You can choose between Oracle JDK and OpenJDK distributions. Oracle offers downloads official, while OpenJDK is the open-source alternative under the GPL license. Within OpenJDK, Adoptium Eclipse Temurin is a very popular option and frequently updated by the community.
Check if you already have Java installed
Before you touch anything open one terminal o symbol of the system and checks if Java is present and in the system PATH.
- Opens CMD o PowerShell in Windows, Terminal on macOS or a console on Linux.
- Run the command:
java -versionIf you see a version, you have Java installed; if not, it will show that the command is not recognized.
For added security, you can also run javac -version, which checks for the presence of the JDK compiler; if you only have the JRE, javac won't appear.
Download Java: Oracle, OpenJDK and Temurin
The traditional way is to go to the official Oracle website or OpenJDK distributions; choose the latest stable version unless you need specific compatibility (for example, Java 8 in certain educational environments or legacy projects).
- From Oracle: Go to the downloads section and choose the installer for your system (Windows, macOS, Linux). Accept the license key before downloading.
- OpenJDK/Adoptium Eclipse Temurin: Open source distribution under the GPL, with maintained and updated builds. It's perfect for development and production.
If you are working with third-party software that requires a specific version, download that specific version number. Older version archives are available from the Oracle archives and community-maintained repositories.
Installation on Windows (official installer)
The process is straightforward: download the JDK .exe (Oracle or OpenJDK) and launch the wizard.
- Run the installer .exe and accept the wizard steps.
- If offered the option, check. 'Set JAVA_HOME variable' to save time with the environment variable.
- Finish the installation and close the wizard. From here you can configure the environment if you didn't set it up automatically.
If you want to check the installation location, the usual thing is something like C:\Program Files\Java\jdk-XX (where XX is the version).
Installation on macOS (.dmg installer)
On macOS, download the .dmg package from the chosen provider (Oracle or Adoptium Temurin) and follow the graphical wizard.
- Open the .dmg that you have downloaded.
- Double click on the package and complete the installation with guided steps.
- Once installed, check with
java -versionthat the system finds the correct version.
On modern versions of macOS, The paths to the installed JDKs are usually in /Library/Java/JavaVirtualMachines/, with subfolders per version.
Installation on Linux (Debian/Ubuntu, Fedora, Arch)
On Linux, it is most convenient to use your distribution's package manager; This ensures integration with the system and automatic updates.
Debian-based distributions (Ubuntu, Linux Mint, etc.)
- Update indexes:
sudo apt update - Install the default JDK:
sudo apt install default-jdk
Red Hat-based distributions (Fedora, etc.)
- Install OpenJDK 11 (example):
sudo dnf install java-11-openjdk
Arch-based distributions
- Sync and install:
sudo pacman -Syu - Install the JDK (example with the default version):
sudo pacman -S jdk-openjdk - To locate available versions:
sudo pacman -Ss jdk
In Linux you can have multiple versions at once; use alternative tools (like update-alternatives in Debian/Ubuntu) to select the default.
Installation with package managers: Chocolatey (Windows) and Homebrew (macOS)
If you prefer a quick and reproducible method, use a package manager. Chocolatey (Windows) and Homebrew (macOS) simplify the process and make future updates easier.
Windows with Chocolatey
First install Chocolatey. Open PowerShell as administrator and runs:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
If you don't see any errors, experiment choco o choco -? to confirm that it was installed.
Now install Temurin 8 (Java 8) with Chocolatey: choco install temurin8
Chocolatey will ask you for confirmation of the script; respond with Y or A to continue. A message like 'Chocolatey installed 1/1 packages' indicates that everything went well.
Open a new terminal and check: java --version. If you see something like 'Java is not recognized as an internal or external command…', check the PATH and JAVA_HOME variables or reinstall the package.
macOS with Homebrew
Install Homebrew from Terminal with the official script: run
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then add the versioned casks repository: brew tap homebrew/cask-versions
For Temurin 8 from cask, run: brew install --cask temurin8. If 'temurin8 was successfully installed!' appears, all right.
Configure JAVA_HOME and PATH
To compile and run smoothly, set the JAVA_HOME variable and make sure you have the Java binary in your PATH.
Windows
- Identify the path of the JDK, for example:
C:\Program Files\Java\jdk-11 - Go to Control Panel → System → Advanced system settings → Environment Variables.
- Create a user or system variable called JAVA_HOME with value the JDK route.
- Edit PATH and add:
%JAVA_HOME%\binat the beginning or in a priority position. - Open a new terminal and check:
echo %JAVA_HOME%yjava -version
macOS and Linux
- Find the path to the JDK (on macOS, it's usually in
/Library/Java/JavaVirtualMachines/<versión>/Contents/Home; on Linux it depends on the package installed). - Open your shell profile file (
~/.bashrc,~/.zshrco~/.bash_profile). - Add these lines (adjusts the route):
export JAVA_HOME=/ruta/a/tu/jdk
export PATH="$JAVA_HOME/bin:$PATH"
Save, reload the configuration with source ~/.bashrc (or the corresponding file) and try again java -version.
Verify the installation
With everything configured, check that Java is responding and that the paths point to the correct JDK.
- JVM version:
java -version - Compiler version:
javac -version - Binary location: on Windows,
where java; on macOS/Linux,which -a java
If there are several versions and the active one is not the desired one, Check PATH/JAVA_HOME or use the system alternatives (for example, update-alternatives in Debian/Ubuntu).
Install and configure an IDE (IntelliJ, Eclipse, VS Code)
A good IDE saves time and headaches; IntelliJ IDEA, VS Code and Eclipse are safe bets to start with.
Quick example with IntelliJ IDEA
- Download and install IntelliJ IDEA from their website. The Community edition is more than sufficient for standard Java.
- When creating a project, select the JDK you just installed and choose Maven if you want automatic dependency management.
- With Maven, you generate a pom.xml file with project information, dependencies, plugins, and build lifecycle.
In VS Code, with Java extensions, You will have support for debugging and compilingIn Eclipse, the setup is similar: when creating the project, you select the appropriate JDK and build type (Maven/Gradle).
Eclipse IDE: Recommended Version and Download
In certain academic settings and laboratories, Eclipse IDE 2024-06 is usedYou can use a newer version, but if you follow classroom documentation, sticking to the specified version will make your life easier.
Download the 'Eclipse IDE for Java Developers' package for your operating system or use the 'Eclipse Installer'; both ways are valid. Install it, select the JDK, and verify that it compiles and runs on your computer.
Java Versions: Compatibility and Targeting Java 8
Although the latest stable version of Java is progressing rapidly (currently much faster than Java 8), Many projects and subjects continue to target Java 8 for compatibility. This means not using features introduced after 1.8.
If you develop with a current version (for example, 21 or 22), Make sure you compile with compatibility towards 1.8 when required and test the code where it is to be evaluated or deployed.
Alternative methods: manual installation vs. managers
You have two paths: manual installation with the official installer (more visual and guided) or using package managers (Chocolatey on Windows and Homebrew on macOS), which simplify installations and updates.
With package managers, the order is clear: one command and that's itManually, you have more fine-grained control throughout the wizard and installation path.
Details for practices: attendance, delivery and evaluation
In teaching contexts, compulsory attendance may be required to practice sessions, with a limited number of justified absences. Review your center's rules to avoid surprises.
The delivery of practices is usually done on a designated server; Submit your work following the guidelines formatting and deadlines. There are often verification tools ('oracles') that run automated tests and validate documentation (Javadoc).
The 'oracle' may return results like 'documentation is error-free', 'OK', 'INCORRECT' or 'DOES NOT COMPILE'; If you see errors, check names, visibilities, signatures and dependencies. It doesn't usually provide any clues about the specific fault, so you'll need to fine-tune your local testing.
At in-person checks, you will normally need to develop in the laboratory with the assigned PC, without paper notes or external devices, and uploading the solution to the indicated platform during There Of the test.
- Respect the position and schedule assigned and do not turn on the equipment until the teacher tells you to.
- Do not connect devices USB nor use portable personal data during the control.
- You can only deliver from the assigned lab and PC during your session; other attempts are usually invalidated.
Grades are published after correction; Use forums and in-person tutorials for specific questions, avoiding sharing open source code if the rules so require.
Character encoding: uses UTF-8
To avoid compilation errors and strange characters, set your project to UTF-8. On Linux and macOS, this is usually the default; on Windows, it's a good idea to check it.
In Eclipse, open the project properties (Project → Properties) and, under 'Resource', set 'Text file encoding' to UTF-8. Apply and close. If any strange characters appear, replace them with the correct UTF-8 characters.
Avoid editors that change the encoding without warning (such as some older Notepad modes); use modern IDEs or editors that respect UTF-8 and line endings Unix when necessary.
In shared or automatically evaluated projects, A non-UTF-8 file can break compilation. Make sure all fonts and resources use the same character set.
Practical recommendations and final verification
Once everything is installed, it is advisable to perform a comprehensive check: create a simple project, compile it, and run it. This will verify that the JDK, IDE, and PATH are working together correctly.
- Create a 'HelloWorld' class and compile: If javac works, the JDK is fine..
- Run the class with
javaand confirms that it prints to the console. Everything is in order if there are no errors. - If you use Maven, try
mvn -vto check integration with Java and the environment.
If something goes wrong, review the steps: JAVA_HOME correct, PATH pointing to .../bin, and that there are no remains of previous installations in conflict.
Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.