Reached End of File While Parsing

Asian businessman thinking at desk in office
Jetta Productions / Getty Images

The Java error message "Reached End of File While Parsing" will be generated if a closing curly bracket for a block of code (e.g, method, class) is missing.


In the code below the method called main does not have a closing curly bracket. The compiler cannot parse the code properly and will throw a reached end of file while parsing compile-time error:

public class Main {
public static void main(String[] args) {
System.out.println("Oops missed a curly bracket..");