Added a new JavaClass, modified new Java class to catch errors