Minecraft crashing with OptiFine and exit code 255: what to check
Save logs/debug.log from the Forge instance that crashed. Check the exact Minecraft, OptiFine and Forge builds before you repeat the failed step in a separate copy.

If Minecraft closes with exit code 255 after you add OptiFine, copy logs/debug.log from the failed Forge instance before you launch again. Save the matching file in crash-reports if one exists. Use the stage that failed and the first error tied to it to choose what to check.
- Before the main menu or on the loading screen. Read the exception around the failed startup. If Forge lists a missing mod or a version range, check that exact requirement first. For a failure while rendering the loading screen, save the Java exception and verify the listed Minecraft and Forge pairing.
- When you open a world or join a server. Keep your original world intact. Check whether a disposable local world loads with the same client configuration. If the failure only happens when you join one server, record that stage and keep the client log from the failed join.
- When you select a shader pack. Record its name and your exact OptiFine build. If you can reach Video Settings, set Shaders to OFF in your test instance and repeat the scene. If the game closes before the menu opens, use a separate trial without the shader pack and compare the startup logs.
The folder steps below cover Minecraft: Java Edition. If you play OptiFine on its own, keep the installation's logs/latest.log or the output shown by its launcher.
Get the game log from the installation that failed
The Forge support guide shows how to find the failed profile's log in the official launcher, CurseForge and Prism Launcher. If the game stays open, use the checks for missing OptiFine controls instead of diagnosing a startup crash.
- Minecraft Launcher. Open Installations, hover over the Forge profile that failed and click its folder icon. Open
logs/debug.login that game's folder. - CurseForge on Windows. Right-click the pack and choose Open Folder. Save the failed run's
logs/latest.logand crash report before restarting. To collect a new Forge debug log, open CurseForge settings, select Minecraft, turn on Enable Forge debug.log and launch the pack again. - Prism Launcher. Right-click the failed instance, choose Edit and open the Other logs tab. Choose
logs/debug.login the dropdown. Use the same dropdown to find the crash report, if the failed launch created one.

Match the report to the date and time of the failure. Windows can hide the extension and show the file as debug. A file named debug-1.log.gz is from an earlier run. Check its timestamp and contents before using it.
From the saved output, record the exact Minecraft version, Forge build, full OptiFine filename, Java runtime and mod list. If a launch leaves no current game log, check the launcher's output for an error before you try again.
Match the exact builds before testing a conflict
Match the failed installation's Minecraft version to the full OptiFine filename. Check the Forge build in the same row on OptiFine's downloads page. If you need a clean matching pair, follow the OptiFine and Forge installation steps in a separate installation.
For Minecraft 1.21.11, the J9 changelog lists Forge 61.0.8. If that's your setup, confirm that the profile shows that Forge build and the mods folder contains OptiFine_1.21.11_HD_U_J9.jar. Move any previous build out of the test instance before comparing launches.

Read the notes for the exact preview you installed. For example, the 1.21.9 J7 pre2 notes mark Forge unsupported, while the 1.21.8 J6 pre16 notes list Forge 58.1.0.
Read the error before changing the mod list
In the crash report, start with the description and the exception immediately below it. Read the Caused by lines and the messages around them. When the loader names a required mod or a version range, Forge's dependency documentation explains what it checks before loading mods.
A real Create issue about exit code 255 reports Minecraft 1.19.2 with Create 0.5.0i and OptiFine H9. The game stopped while rendering the loading overlay, and the report named a NoSuchMethodError in BakedQuad. In that setup I'd check which versions were loaded, then try the same stage in the copied pack with OptiFine disabled.
A separate Fabric report with the same code names a missing SmartBrainLib class during a mod's startup. Follow the dependency named by your own log and check its required version. Generic lines such as the final exit code can appear in both cases.
If a reduced mod list produces a new missing-dependency error, restore the requirement and repeat the comparison. Record the first result that matches the original failure's stage and exception.
Preserve the pack, then make a small comparison
Close Minecraft and preserve an untouched copy of the profile and its worlds. Check that the copy contains the saves, mods, settings and packs you need. Check any shared or custom folders separately before you change the copy.
In Prism Launcher, right-click the instance and choose Copy. Include the files you need and leave the symbolic link and hard link options unchecked for an independent copy. In that copy, go to Edit > Mods and clear the checkbox next to OptiFine. Repeat the same stage and keep its log alongside the original.

If the copied pack gives the same error with OptiFine disabled, you can reproduce the failure without OptiFine. If the copied pack gets past the same step, check the OptiFine and Forge combination in its own instance.
- In Prism, click Add Instance and select the Minecraft version and modloader. Match the recorded Minecraft version and the Forge build listed for your OptiFine build. Verify those exact versions in the new instance before comparing; a different loader build changes the test.
- Launch that Forge instance with no added mods. For a startup crash, check whether it reaches the main menu. If it fails there, keep the log and stop adding mods until that baseline launches.
- Add only the matching OptiFine JAR and check the same stage. Keep settings fixed. For a world or shader symptom, use a disposable local world and repeat the same action. Leave your original modded world in the intact instance.
- If the pair works alone, add back optional mods in recorded groups. Keep each mod with its required libraries. Repeat the same action and keep the mod list and log for each group.
- If a group restores the original error, undo that group and confirm the previous launch still works. A new missing-library error means the reduced trial needs that dependency restored before you compare it again.
The first group that reproduces the problem narrows the interaction. Leave the diagnostic files in the separate instance and switch back to the original profile when you're done.
If you ask for help, share the log and crash report that match the failure. Include the exact builds, mod list and the last comparison that changed the outcome. Review what you share for account identifiers or private server addresses first.

