How to Solve the error in JSON file of eclipse

Sometimes our back-end brother doesn’t want to write HTML and is lazy to download a front-end page. As a result, the JSON file in it always reports errors

Although it can work normally, red x looks unhappy. How to solve it

This is because eclipse thinks that JSON files do not need comments, so we can turn off the compilation check of the reported compilation errors through eclipse settings

Window → preferences → validation → JSON validator

Remove the check boxes of manual and build, and click apply and close. Just ojbk

After eclipse re checks and compiles the project, it is found that JSON no longer reports compilation exceptions

If you want to check whether the JSON file can be compiled normally, you can copy the content of the JSON file and put it into a gadget to check the JSON format. After searching a lot on the Internet, it is not recommended

 

Similar Posts: