This is a quick tutorial on how we can resolve the issue on the Grails project.
For grails application sometimes we might get the following error
Error: Could not find or load main class org.grails.cli.GrailsCli
This might be due to the removal of some dependencies or libraries from the application. Sometimes, while loading multiple applications from IDE while downloading the library for a particular project other libraries for another project might remove so this kind of error might occurs for that project.
Let's first delete the build folder under the application.
Now, let's refresh the Gradle project. Here we are using IntelliJ Idea, we can refresh the project as below
After refreshing the project it will download the missing dependencies. Then run the application which will resolve the problem.
We can also try cleaning the application.
If we are using the command line then type the following command to clean the application.
grails clean
If we are using the IntelliJ idea then Ctr+Alt+G opens the command window and use the following command.
clean
Now, re-run the app. This will help resolve the issue.