Hello everyone, I am Bai Mo, a love of learning and swimming contradictions.
Yesterday for the convenience of the figure, the use of MyEclipse in the Swing function to draw the interface, after the painting found that it could not run, look at the source code found that the full error, a face Meng than.
In line with the principle of thinking before the event (can not do it, can not give it to others, can not do it tomorrow), I put off today to solve the problem.
Today, after asking Baidu and Sand Eagle group friends failed, I went to consult the lecturer. The teacher told me that “either there is no JRE, or there is no curly brace”, so I went to find out where the curly brace is wrong.
The error message
Exception in thread "main" java.lang.Error: Unresolved compilation problem:Syntax error on token "}", delete this token
I am inFound before the main methodAn incomplete or even miswritten method. In myDelete/comment those two lines of codeAfter that, the error is gone. Perfect solution.
Other solutions for reference:
- Copy the code into Notepad, create a new class, and paste the code back.
- Create a new project and copy the class that reported the error into the new class. (Sometimes can solve the exclamation point problem of the project report)
The above metaphysical solution, I do not know why.
There was an error in Eclipse generating code automatically! The code is not fully generated, and many times there is one more or less closing “} “curly brace. Carefully observe the code, check whether each method is complete, manually modify the correct or delete can solve the error report.
Well, that’s all for this article! If it will help you, I can have it
Thumb up + Favorite + Follow! Your encouragement is my motivation to update!
Welcome to pay attention to my personal public number white ink is a program ape and I in-depth exchange ~