What does EOF FOUND '}' mean in Check style?

10,649

Solution 1

Try formatting it like

public class Hello 
{
  public static void main(String[] args)
  {
     System.out.println("hello, world");
  }
}

and the "s" in system.out.println and string[], should be capital

Checkstyle is a tool which is used to find flaws in formatting and coding conventions followed if any exists in the code. The rules are set using by configuring the checkstyle. And if any part of your code does not abide by them, it will throw an exception. In most of the cases exceptions will be self explanatory. You can use google depending on the exception you get.

Solution 2

This problem became a real issue in the checkstyle project. Basically it was related with the use of lambdas, yet the problem exposed herebefore is clarely not related to Java 8 lambdas. You can check the issue here. You can solve it by specifying a valid version. In gradle it would be:

apply plugin: 'checkstyle'
checkstyle {
    toolVersion = "6.1.1"
}
Share:
10,649
Gamoonbi
Author by

Gamoonbi

Updated on June 17, 2022

Comments

  • Gamoonbi
    Gamoonbi almost 2 years

    I'm using intellij communicated version and also add checkstyle plugin

    how ever, i made simple java file just say hello

    public class hello {
    public static void main(string[] final args)
    {
        system.out.println("hello, world");
    
    }
    }
    

    it's simply run. however checkstyle tell me there is problem at the last line. he told me

    Got an exception-expecting EOF, Found '}' error

    I don't know what is the problem. block is correctly close.
    is there something i need to add or fix that ?