How to install OptiFine in Minecraft and where the file goes
Run your exact Minecraft: Java Edition version once, open the matching OptiFine JAR and click Install. Then select OptiFine in Minecraft Launcher. On compatible Forge, put the intact JAR in that installation's mods folder and launch Forge.

Get the OptiFine JAR for your exact Minecraft: Java Edition version. For a standalone install, run that Minecraft version once, open the JAR with Java, click Install and launch OptiFine from Minecraft Launcher. With compatible Forge, put the intact JAR in that installation's mods folder and launch Forge. Open Options > Video Settings in the game to check that OptiFine loaded. If the installer stays closed, check what Java reports.
Match the Minecraft version before choosing a file
In Minecraft Launcher, open Minecraft: Java Edition > Installations. On the installation you want to use, open the three-dot menu, select Edit and read the Version field. For a clean profile, create a new installation and select the version from the Version list. Copy the full number. In the OptiFine catalog, click Show all versions to reveal builds beyond the first few rows. If the launcher shows 1.21.1, scroll to that exact Minecraft heading.
For example, the 1.21.11 row lists OptiFine HD U J9, with Forge 61.0.8 beside it. Its file is OptiFine_1.21.11_HD_U_J9.jar. The J9 changelog confirms that Forge pairing. This guide uses J9 to make the file moves concrete; use the row for your own Minecraft version.
Pick a release for your exact game version when the catalog offers one. If it has previews only, expand + Preview versions and read the selected build's changelog for feature limits. If the full catalog has no entry for your version, keep playing without OptiFine or make a separate installation for a supported version. Back up an existing world before you try to open it in an older Minecraft version. The Forge column belongs to that exact JAR. A row marked N/A lists no Forge pairing.
These files work with Java Edition. Bedrock Edition on Windows, phones and consoles has no OptiFine build. On Fabric, OptiFabric is a separate bridge with its own version and mod limits. Prism's Quilt notes list no known working setup. Use the Forge steps below only with a Forge build paired with your OptiFine JAR.
Download the intact JAR from optifine.net
On the matching row, I'd use (Mirror): it opens the download page on optifine.net, while the main Download link passes through an advertising link. Click Download on that build's page, then check the saved filename. The J9 download page names the exact JAR, so an unrelated executable or browser extension isn't the expected file.
Keep the JAR intact. You don't need to unpack it into the game's files. OptiFine's copyright terms require advance written permission for public redistribution, and its FAQ applies a permission requirement to modpacks. Download your own copy from the developer rather than taking a re-upload from a mod bundle or a look-alike site.
Install it on its own in Minecraft Launcher
Use this route when you want OptiFine without Forge. You'll need the official Minecraft Launcher, the matching plain Minecraft version, and a Java runtime that can open the downloaded JAR.
- Start the matching plain Minecraft version once. For the J9 example, select a 1.21.11 installation, play to the title screen, then quit the game. The community-maintained OptiDocs installation instructions put this step before the installer: the matching vanilla version must already be installed and have run.
- Open
OptiFine_1.21.11_HD_U_J9.jar. Find it in your downloads folder on Windows, macOS or Linux. The expected result is the OptiFine installer window. If double-clicking opens an archive, browser or text editor, stop at the Java checks below. - Check Folder, then click Install. Use the Minecraft folder that contains your installed
versionsdirectory. If the installer can't find Minecraft, start the exact vanilla release again and check the folder it is looking in. The standalone installation steps finish with a new OptiFine profile in Minecraft Launcher. Wait for the installer's success dialog before you close it.

- Reopen Minecraft Launcher and play OptiFine. Choose the OptiFine installation in the selector next to Play, then click Play. Launching the plain 1.21.11 installation again will leave you in vanilla Minecraft.

If OptiFine isn't visible under Installations, enable the Modded filter. The launcher separates Releases, Snapshots and Modded installations. Check the selected installation's version before opening a world.
If the JAR won't open
Open a terminal in the folder containing the download and run java -jar "OptiFine_1.21.11_HD_U_J9.jar". Substitute your exact filename. Java's -jar option starts the installer, where you can click Install.
Run java -version if the command fails. If the terminal can't find Java, choose a runtime for your operating system and processor from Eclipse Temurin, follow Adoptium's setup steps and open a new terminal. If you get Unable to access jarfile, check the filename and the folder you're in. If the installer opens from the terminal, you can finish there even if double-click still opens another app. If the command leaves you stuck, follow the OptiFine JAR checks for your exact symptom.
Add it to an existing Forge installation
Use this route after Forge reaches the title screen on its own. Start with the Forge build printed beside the OptiFine entry. For this example, use Minecraft 1.21.11 and Forge 61.0.8 with J9. If your modpack calls for a different Forge build, leave the pack as it is until you've found an OptiFine JAR that the catalog pairs with it. If the Forge profile does not exist yet, start with the separate Forge installation walkthrough.
Keep a backup of your worlds before changing a modded installation. The OptiFine FAQ says to install OptiFine last, with exceptions for mods explicitly designed to follow it. For this route, put Forge in place first, confirm it starts, then add OptiFine.
- Start that Forge installation once, then quit the game. Forge creates
modsunder its game directory if the folder is missing; its game-directory path definitions make that relationship explicit. - Open the installation's game directory. In Minecraft Launcher > Installations, use the folder icon on the Forge installation. If its Game directory field uses a custom path, that path is the one that matters. In another launcher, open the selected instance's game folder through that launcher.
- Put
OptiFine_1.21.11_HD_U_J9.jarinsidemods. The developer's Forge method uses the same intact JAR you downloaded. For a default game directory, the Minecraft Wiki's operating-system locations give these destinations:- Windows:
%APPDATA%\.minecraft\mods\OptiFine_1.21.11_HD_U_J9.jar - macOS:
~/Library/Application Support/minecraft/mods/OptiFine_1.21.11_HD_U_J9.jar - Linux:
~/.minecraft/mods/OptiFine_1.21.11_HD_U_J9.jar
- Windows:
- Launch Forge again. Choose the Forge installation, not the standalone OptiFine installation. The loader should now pick up the JAR from its own
modsfolder.
Those are default paths, not three folders to populate. Use only the folder belonging to the installation you launch. In Prism Launcher, for example, Edit > Mods > Add file adds the downloaded JAR to the selected instance; its standalone installation method is different from the official launcher's Install button.
Confirm OptiFine loaded in Video Settings
At the title screen, open Options > Video Settings. Look for OptiFine buttons such as Shaders..., Quality..., Details..., Performance... and Other.... These labels appear in OptiFine's English language definitions; its FAQ also names routes through Details and Other. The button positions can vary by version. Open Shaders... if it is present. You can confirm the menu opens without installing a shader pack.

If the extra controls are missing, check the installation you selected in Minecraft Launcher. In a standalone setup, select OptiFine. In a Forge setup, check that the intact JAR sits in the selected installation's mods folder and that its full Minecraft version matches the installation. If Forge stops launching after you add the JAR, move it out of mods and check that the original setup starts.


