Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails 2.0.3 error starting from command line in Windows7

Tags:

windows

grails

Hoping a kindred soul can assist with this odd windows problem

I am attempting to run a grails app on windows and am unable to get grails to start.

I have both downloaded the 2.0.3 distro from grails.org and pulled and built the source off of github.

The error I receive is as follows:

Error: Could not find or load main class 
       org.codehaus.groovy.grails.cli.support.GrailsStarter

The searching I've done to find solutions to this problem (which some people have had) have yielded no help: All I've found is suggestions that my environment variables are improperly set up. (e.g. here)

I felt I was quite careful in setting up my variables though. I have the following configured, all under System Variables:

JAVA_HOME C:\java\jdk7
GRAILS_HOME C:\grails\2.0.3  // also set it to C:\grails\source\grails-core when dlded from source
GROOVY_HOME C:\groovy\1.8.6
PATH %JAVA_HOME%\bin;%GRAILS_HOME%\bin;%GROOVY_HOME%\bin;$PATH

I've tried things both before and after downloading groovy and setting that environment variable, and I'm afraid I'm quite lost at this point. Groovy starts just fine, java starts just fine, but grails is unable to start.

Is anyone else in Windows having this issue with the latest grails version?

like image 592
Will Buck Avatar asked Apr 22 '12 01:04

Will Buck


2 Answers

I ran into this error message in the DOS CMD shell. Turned out, I had my GRAILS_HOME set to 2.2.0 but my PATH was pointed to Grails-2.2.1\bin. Once I fixed this mismatch, the error went away and things worked fine. Suggest using "set" in your CMD shell to see what your environment is actually set to.

like image 184
SunilJ Avatar answered Oct 19 '22 18:10

SunilJ


I feel like a fool for not trying this, but...

Grails is working as a command from the Windows DOS prompt (cmd). It is NOT working from the bash I've been using on windows (git bash, out of convenience and familiarity with the linux cmds).

For those of you that find yourselves in this situation, Make SURE you try this in the Windows cmd prompt as well. (Those with any insight into why this is working in the DOS prompt but not in a custom linux-like bash please weigh in, I will update this answer with any findings I come across!)

like image 36
Will Buck Avatar answered Oct 19 '22 18:10

Will Buck