How to install OptiFine with Forge: mods folder and matching builds
Put the intact OptiFine JAR in the mods folder of the Forge installation you play. Match the exact Minecraft version and the Forge build listed for that JAR. If you're starting fresh, install and launch Forge first.

Put the intact OptiFine JAR in the mods folder of the Forge installation you play, matching the Minecraft version and Forge build shown on OptiFine's downloads page. One documented pair for Minecraft 1.21.11 is OptiFine J9 with Forge 61.0.8. If Forge already works, start with that installation's folder. For a fresh setup, install and launch the Forge client before you add OptiFine.
Match the Minecraft version and the listed Forge build
In Minecraft Launcher, open Installations and check the selected profile's Version. For the example below, the J9 changelog confirms Forge 61.0.8 for OptiFine_1.21.11_HD_U_J9.jar. On the OptiFine downloads page, click Show all versions to reveal older rows. Match the exact Minecraft version and the Forge build alongside that file. For a 1.20.1 pack, keep the pack's installed Forge 47 build while you check the corresponding OptiFine release or preview. For a NeoForge installation, check the separate NeoForge compatibility guide before choosing a file.
Use the listed Forge build when the pack allows it. The Forge site uses its own criteria for Recommended and Latest. If a modpack requires a different build, keep the working instance and check that combination in a separate copy.
Read the Forge column for the exact file, including rows under + Preview versions. If that row says N/A, check its changelog for the reason. The 26.2 K2 pre5 changelog and 26.1.2 K1 pre2 changelog both list incompatibility with Forge.
The edition matters too. The downloads page offers HD U builds, while OptiFine's FAQ says Light is incompatible with Forge. This guide covers Forge, not NeoForge, Fabric or Quilt; a matching Minecraft version alone doesn't make those loaders interchangeable.
Get the intact OptiFine JAR
On the correct OptiFine row, choose (Mirror), then Download on the developer's page. Mirror stays on optifine.net; the main Download link uses an advertising redirect. Check that the saved name matches your chosen build. For the example here, it must be OptiFine_1.21.11_HD_U_J9.jar.
Keep the file intact. OptiDocs' Forge instructions use the original JAR as a mod. The Install button in that JAR is for a separate OptiFine profile.
If Forge is already working, keep its installation
Start your existing Forge installation without adding OptiFine. Let it reach the title screen, then quit. Back up the installation and its worlds before changing it. If the pack already fails, resolve that failure first; adding OptiFine won't give you a clean starting point.
For a launcher-managed pack, work with that selected instance. Its folder can differ from the system's default Minecraft folder. Prism Launcher, for example, uses Edit > Mods > Add file for this step, as its OptiFine instructions explain. Keep the pack's own Minecraft and loader requirements when choosing the file.
For a new setup, install the matching Forge client first
These steps are for the official Minecraft Launcher. Open it and run the matching plain Minecraft version once before installing Forge, then close the game and launcher. The Forge client installer checks for launcher_profiles.json or launcher_profiles_microsoft_store.json in its target folder; its client-install code rejects a folder without a launcher profile.
- Download the matching Forge installer. For J9, open Forge's Minecraft 1.21.11 downloads, choose Show all Versions and find 61.0.8. Its Installer entry has a (Direct Download) link to
forge-1.21.11-61.0.8-installer.jar. The prominent Latest and Recommended buttons can point to a different build. - Open that installer JAR. If double-click opens an archive, open a terminal in the download folder and run
java -jar "forge-1.21.11-61.0.8-installer.jar". Substitute your downloaded filename. If Java is missing, install a runtime for your operating system and processor from Eclipse Temurin. The Forge support FAQ specifies Java 21 for running Minecraft 1.21.11 with Forge. Check the game runtime separately if you use a custom Launcher Java path. - Choose Install client. That is the action Forge defines for the Minecraft Launcher. The target must be the launcher's data folder containing its profile file. It isn't necessarily the separate Game directory you intend to use for a Forge installation. With a standard launcher setup, leave the detected target in place, then confirm the installation.

- Reopen Minecraft Launcher and select the installed Forge version. Under Installations, enable Modded if necessary. For a separate setup, choose New installation, set Version to
1.21.11-forge-61.0.8, and give it its own Game directory. The launcher's create/edit controls keep these choices together. Name it so you can distinguish it from other Forge installations. - Start that Forge installation once, then quit at the title screen. Forge resolves
modsinside its game directory and creates the folder if needed, as its path definitions show. Confirm Forge starts before adding OptiFine.
Put the JAR in that installation's mods folder
Add OptiFine after Forge and after the rest of a working pack. The FAQ's install-order advice allows exceptions for mods specifically designed to follow OptiFine. This isn't an instruction to rename the file to force an alphabetical load order.
- Open the selected Forge installation's folder. In Minecraft Launcher > Installations, hover over the Forge installation and use its folder icon. In another launcher, open the game directory for the selected instance.

- Place the intact JAR inside
mods. For a default game directory, the Minecraft Wiki's OS locations give these final paths:- 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:

- Keep one OptiFine build in the folder. I'd move an older OptiFine JAR to a backup folder outside the instance, so there is no doubt which build you are loading.
If you share a modpack, leave OptiFine out unless you have the developer's permission. Its copyright notice requires advance written permission for public redistribution. Give other players the exact Minecraft version, Forge build and OptiFine filename so they can get their own copy from optifine.net.
Launch Forge and confirm OptiFine loaded
In Minecraft Launcher, select the Forge installation and click Play. At the title screen, open Options > Video Settings. Look for the extra controls named in OptiFine's English language file, such as Shaders..., Quality... and Details.... Their positions can vary by Minecraft version.
If the buttons are missing, check the selected installation, its full Minecraft/Forge version and the mods folder you edited. For this example, the selected version must be 1.21.11-forge-61.0.8, with OptiFine_1.21.11_HD_U_J9.jar in its mods folder.
If adding OptiFine stops the game from starting
Move the OptiFine JAR out of mods and try the previously working pack. If it still fails, keep your backup and read the current launcher error and game log. If the game only fails with OptiFine in place, use the isolated check below before changing more files.
To isolate the pairing, create a separate Forge installation with an empty Game directory and add only the matching OptiFine JAR. Stop at the title screen and Video Settings; don't load an existing modded world with its required mods missing. If the pair starts there, investigate the pack's other components in a copy. Keep required libraries and dependent mods together: a missing-dependency error isn't evidence of a graphics conflict, and a failure appearing after adding a group doesn't identify a single mod by itself.
Once the full intended setup starts and the OptiFine controls appear, continue with that installation. If a later video-setting change causes trouble, Video Settings > Other > Reset Video Settings is the FAQ's route back to default settings.


