Optifine

So I’m sure there are more people with this issue but whenever I try to open Optifine through Java it crashes instead of letting me install? Does anyone know how to fix this?