To anyone, who has got the same problem, NoClassDef when running minecraft with exported jar (in environment everything works), I did an inspection in Intellij and found the SideOnly missing from GuiHandler and Keyhandler. You might have different "hidden" problems, just use the inspection.