OptiFine 1.18.2 Download and Forge 40.2.9 Setup
Use the H9 release for Minecraft Java 1.18.2. Pair it with Forge 40.2.9 or install it on its own after running Minecraft 1.18.2 once.

Use the OptiFine HD U H9 release for Minecraft Java 1.18.2. For a fresh Forge setup, match it to Forge 40.2.9, the build named next to H9 in the developer’s catalog. If you play through the official launcher without Forge, run plain 1.18.2 once and use the standalone installer.
Tell H9 apart from the older search results
Search can drop you on the older H6 file page. The H6 changelog pairs it with Forge 40.0.12. H7’s changelog names 40.0.24. I’d choose H9 for a new installation because the H9 release notes add shader, visible-chunk and modded block-entity fixes. Keep an older pair if a working modpack explicitly depends on it.
On the OptiFine downloads page, click Show all versions, find Minecraft 1.18.2 and open (Mirror) on its H9 row. Read the whole title on the next page before clicking Download. Save OptiFine_1.18.2_HD_U_H9.jar. The H9 label also appears on releases for other Minecraft versions, so the 1.18.2 part of the filename matters.

Set up a separate Forge 40.2.9 profile
On Forge’s Minecraft 1.18.2 download page, open Show all Versions. Find 40.2.9 and use the Installer on that row. The large Latest and Recommended buttons may point to a different build.

Open the Forge installer, select Install client and start the resulting Forge profile once. Quit at the title screen. In Minecraft Launcher, open Installations and click the folder icon for that Forge profile. Put the intact H9 file in that folder’s mods directory. If you use Prism with an existing Forge instance, open Edit → Mods → Add file in the selected instance. Prism’s Forge instructions use the original JAR for this route.

If your modpack pins a different Forge build, leave its loader in place. Make a separate copy, confirm its paths are independent and start the copy with H9 as the only change. Check the title screen and Options → Video Settings, then create a disposable world. A pack can reach the menu and still fail when it opens a world. If either step fails, disable or remove H9 in the copy and repeat the step. Keep the original pack intact. If you see Exit Code 255, start with the log checks for Exit Code 255.
Use the standalone installer if you play without Forge
In Minecraft Launcher, launch plain 1.18.2 once and quit. Open the H9 JAR with Java, check the destination folder and click Install. Select the new OptiFine installation before pressing Play. Mojang’s Java Edition 1.18.2 launcher record specifies Java 17 for the game. If the launcher works but double-clicking the installer does nothing, check the Java program that opens the OptiFine JAR separately.
In the game, open Options → Video Settings and look for OptiFine controls such as Quality and Shaders. If these are missing, confirm that the selected installation runs 1.18.2 with H9 before changing a graphics setting. When switching a working world between profiles, keep a world backup separate from the copy you use to test.


