简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM