Eddard Stark
Eddard Stark

Reputation: 3595

Grails not running

I am trying to run grails in my laptop, I have installed jdk 1.8.0 and jre8, I have set JAVA_HOME and GRAILS_HOME correctly. When I type %JAVA_HOME% or %GRAILS_HOME% in command prompt, it displays correct paths. But when I try to run any grails command, I get the following error:

| Loading Grails 2.1.1
| Error java.lang.reflect.InvocationTargetException
| Error         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
| Error         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error         at java.lang.reflect.Method.invoke(Method.java:491)
| Error         at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:234)
| Error         at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)
| Error         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
| Error         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error         at java.lang.reflect.Method.invoke(Method.java:491)
| Error         at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:234)
| Error         at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)
| Error Caused by: java.lang.NullPointerException: Cannot invoke method getAt() on null object
| Error         at grails.util.BuildSettings.configureDependencyManager(BuildSettings.groovy:1208)
| Error         at grails.util.BuildSettings$configureDependencyManager.callCurrent(Unknown Source)
| Error         at grails.util.BuildSettings.postLoadConfig(BuildSettings.groovy:1121)
| Error         at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1003)
| Error         at grails.util.BuildSettings$loadConfig.callCurrent(Unknown Source)
| Error         at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:978)

My laptop has windows 8. Any help regarding this would be greatly appreciated.

Upvotes: 18

Views: 12343

Answers (5)

Rezaul
Rezaul

Reputation: 620

Now Grails 3+ version support java8 and there are lots of feature with new build system and also integrated spring boot. So you can update your project with grails 3+ version. But you need to Change your application architecture cause of spring boot and gradle build system.

Upvotes: -1

zinking
zinking

Reputation: 5695

for my case, I re-synced the JDK home link. I use quite a few java versions these days.

after install the intrusive jdk1.8.0_51. THE /Library/Java/Home get overridden (maybe in most cases intended). if you just want to play with jdk1.8 and works mainly under other versions, you should link this place back

Upvotes: 0

mohsenmadi
mohsenmadi

Reputation: 2377

Switch to Grails 2.5.0 to run on jdk8u40+.

Also, if you are using the IDE GGTS, make sure it is v3.6.4, and that you install Groovy 2.4 from the extensions page to get the show on the road.

Upvotes: 0

Sumon Bappi
Sumon Bappi

Reputation: 2019

grails 2.4 works with jdk - 8. grails 2.1.1 works with jdk - 7.

Upvotes: 3

Eddard Stark
Eddard Stark

Reputation: 3595

I was using java8, I tried using java7 and it worked fine! Apparently grails does not work with java8

Upvotes: 25

Related Questions