init java solution