4
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\ubiquibacon>set

GRAILS_HOME=C:\Program Files\GGTS\grails-2.0.4
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_25
Path=C:\Program Files\Java\jdk1.7.0_25\bin;C:\Program Files\GGTS\grails-2.0.4\bin

C:\Users\ubiquibacon>grails
Error opening zip file or JAR manifest missing : C:/Program
Error occurred during initialization of VM
agent library failed to init: instrument
C:\Users\ubiquibacon>

I have two main Grails project I work with. Project "A" is in production is developed with Grails 2.0.4 using Netbeans, project "B" is still a prototype and is developed with Grails 2.2.4 using GGTS. I have a .bat script I run to quickly change my GRAILS_HOME and PATH variables when switching between the two versions of Grails. This worked well until I decided to play around and open project "A" in GGTS. I also recently upgraded Java from 1.6.0_18 x86 to 1.7.0_25 x64. Now something is preventing Grails 2.0.4 from running at all as can be seen from the posted command line output. My environment variables and path are correct, I have deleted the .grails directory, and I have restarted my computer, none of which have helped correct the problem.

The first line of the error is curious because it appears to be looking in a non-existent path C:\Program. I wonder if the rest of the path may be getting hacked off because of a space C:\Program Files\??? but that is just a thought.

I have already tried all the answers to this question, none of which helped solve my issue.

Any guidance would be appreciated.

Update:

A work around listed in the JIRA issue here says to change line 60 of startGrails.bat from this:

set AGENT_STRING=-javaagent:%GRAILS_HOME:\=/%/lib/com.springsource.springloaded/springloaded-core/jars/springloaded-core-1.0.5.jar -noverify -Dspringloaded=profile=grails

to this:

set AGENT_STRING="-javaagent:%GRAILS_HOME:\=/%/lib/com.springsource.springloaded/springloaded-core/jars/springloaded-core-1.0.5.jar" -noverify -Dspringloaded=profile=grails

After doing that I get a new error:

C:\Users\westerhold>grails


Exception: java.lang.NumberFormatException thrown from the UncaughtExceptionHandler in thread "main"
C:\Users\westerhold>
Community
  • 1
  • 1
ubiquibacon
  • 10,451
  • 28
  • 109
  • 179
  • It is quite unfortunate that GVM is only available for UNIX/LINUX so Grails installation is slightly harder on Windows. Maybe it is time to try Linux for development :) – sola Dec 20 '13 at 13:22

3 Answers3

5

Obviously the error cause is spaces in the path. Try to reinstall Grails by the path without spaces.

akirillov
  • 77
  • 2
  • The spaces were part of the problem. Installing Grails to a path without spaces was necessary (for Grails 2.0.4) unless I did the work around I mentioned in my question, but even with spaces removed the error persisted. The problem didn't go away until I changed `JAVA_HOME` to the 32 bit Java 6 install path. – ubiquibacon Sep 06 '13 at 21:09
  • you have solve my problem but can you tell me why was this happening ? – Mohsin AR Mar 29 '14 at 21:40
3

While giving path in environment variable there should not be space,this is wrong C:\Programs Files\grails-2.3.4 so the solution is giving path like with no space C:\Programs\grails-2.3.4

Hope it help :)

Anil Shrestha
  • 51
  • 1
  • 5
  • 1
    In my case, I needed to add a trailing slash in the GRAILS_HOME variable for some reason – john Apr 10 '15 at 18:12
0

I don't know why, but when I use the older version of Java I don't have any issue. I don't know if it is because my older version of Java was Java 6 instead of Java 7, or because my older version of Java was 32 bit instead of 64 bit, but setting my JAVA_HOME variable to point to the older version of Java when using Grails 2.0.4 seems to be working.

ubiquibacon
  • 10,451
  • 28
  • 109
  • 179