You can install OptiFine without manually installing Java on macOS or Windows. It involves the command line but the process is quite simple. On Windows or macOS, Minecraft Java Edition manages its own Java installation. We can use this Java to run the .jar OptiFine installer.