Cannot launch Java application Uncaught exception in main method

As I was trying to create an applet for school Java suddenly crashed. The error message “Cannot launch java application Uncaught exception in main method:Java.lang.NullPointerException” was produced.
Should I reinstall Java or is there a quick fix for this issue?

