Added error handling for when the Java code generator cannot write the generated Java source code files to disk

Issue #381