Elemér Botos
Elemér Botos

Reputation: 154

Could not find or load main class org.grails.wrapper.GrailsWrapper

I have windows 10, with latest JDK. I'm trying to run a grails application (2.5.0). I'm gettin the error message which is also in the title: "Error: Could not find or load main class org.grails.wrapper.GrailsWrapper". The weird thing is that it works rarely, the same command.

So we checked the shell build script, and it tries to run the application with the following command: "

%JAVA_HOME%/bin/java -server -Xmx768M -Xms64M -Dfile.encoding=UTF-8 -classpath wrapper/grails-wrapper-runtime-2.5.0.jar:wrapper:. -Dgrails.home=%GRAILS_HOME% -Dtools.jar=%JAVA_HOME%/lib/tools.jar -Djava.net.preferIPv4Stack=true org.grails.wrapper.GrailsWrapper --main org.grails.wrapper.GrailsWrapper --conf %GRAILS_HOME%/conf/groovy-starter.conf --classpath

I have replaced JAVA_HOME and GRAILS_HOME for readability. But we have checked them and they are the right one.

Any suggestions are welcome.

Upvotes: 2

Views: 3363

Answers (1)

Srikanth Anusuri
Srikanth Anusuri

Reputation: 1409

Your classpath is expecting the wrapper jar to be in the wrapper/grails-wrapper-runtime-2.5.0.jar location relative to the directory in which you are running the command. Are you running the command in the project directory where the shell script can locate the wrapper runtime jar? If not, you will need to update the classpath in the script to point to the absolute path or use dirname command to evaluate the classpath directory.

Upvotes: 2

Related Questions