Search code examples
javaintellij-ideaeofcheckstyleintellij-14

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


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 ?


Solution

  • 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.