Installing Java on Linux
26.1.2Minecraft Java Edition and the OptiFine installer both need a Java runtime. The official launcher bundles one for the game, but that runtime is not always registered for opening .jar files — which is why the OptiFine installer sometimes does nothing when you double-click it. Installing a standalone JRE fixes it.
Choose your OS
Pick your operating system if you'd like to switch guides:
Which Java version do I need?
- Minecraft 1.17 and newer: Java 17 or later.
- Minecraft 1.20.5 and newer: Java 21 or later.
- Older versions: Java 8 still works.
When in doubt, install the latest LTS build of Eclipse Temurin — it covers every modern OptiFine release.
1. Download a Java runtime
Download the installer for your system from adoptium.net (Eclipse Temurin) or from oracle.com.
2. Install it
Run the installer and accept the default options. A restart is not usually required.
3. Check that it works
Open a terminal or command prompt and run:
java -versionIf you see a version number, Java is installed correctly.
Notes for your system
Install OpenJDK from your package manager:
sudo apt install openjdk-21-jre # Debian / Ubuntu
sudo dnf install java-21-openjdk # Fedora
sudo pacman -S jre-openjdk # ArchWith Java installed, continue with Installing OptiFine.