Optifine has a known bug at the moment, causing it to crash with exit code 0. Thankfully the fix is pretty simple. The crash is caused by Optifine looking for a maximum launcher version of 2.2.1, while the beta launcher is 2.2.2. As a result, to fix it, you’ll need to leave the beta. Follow the steps below to switch back to the release version.
Leaving the beta won’t affect worlds or other save data. However, if you’re worried about losing them, make a backup before following this guide.
Open the launcher and click settings in the lower left.
Uncheck the box next to Use beta version of the Launcher
Restart the beta launcher and wait for the update/downgrade to complete.
Click Play and verify that Optifine now loads.
Need more help?
If you have any problems following the steps above, make a post on r/MinecraftHelp and one of us will be happy to guide you through it. If you’re having more general issues with Minecraft: Java edition, check out our basic troubleshooting guide.
Happy crafting folks!