GRAILS_HOME not set on Mac?
Hey guys,
I have the plugin running in 7269. I can create a new grails application fine, but when I try to run it I get the following in the console.
/Library/Java/Home/bin/java -Xmx256M -Dgrails.home=/Users/mike/grails-0.6 -Dbase.dir=/Users/mike/svn/selena-grails -Dtools.jar=/Library/Java/Home/lib/tools.jar -Dgroovy.starter.conf=/Users/mike/grails-0.6/conf/groovy-starter.conf -Dfile.encoding=MacRoman -classpath /Users/mike/grails-0.6/lib/groovy-all-1.1-beta-3-SNAPSHOT.jar org.codehaus.groovy.tools.GroovyStarter --main org.codehaus.groovy.grails.cli.GrailsScriptRunner --conf /Users/mike/grails-0.6/conf/groovy-starter.conf --classpath /Users/mike/grails-0.6/lib/groovy-all-1.1-beta-3-SNAPSHOT.jar:. run-app
Environment variable GRAILS_HOME not set. Please set it to the location of your Grails installation and try again.
Process finished with exit code 0
For the life of me I can't seem to work out how to set environment variables for running the grails application? (It doesn't have a field for it, like other run targets do)
Has no one else had this problem?
Please sign in to leave a comment.
Hello Mike,
GRAILS_HOME should indeed be injected into spawned process. This was a bug that has been recently fixed (Thanks to Jeb Palmer for contributing the fix)
Eugene.
I got this to work, I'm not sure if it's the prettiest solution though (love to hear one if it's easier).
On the Mac, a user's global env properties (for all applications executed by double clicking - ie no shell), are in ~/.MacOSX/environment.plist
For anyone interested, mine looks like this (and Grails apps now run in IDEA)
GRAILS_HOME /Users/mike/grails-0.6 DYLD_LIBRARY_PATH /Applications/YourKit Java Profiler 5.5.3.1.app/bin/mac ]]>
Hope this helps!
Mike Cannon-Brookes wrote:
Works for me with Selena-7274 and newest JetGroovy Plugin.
I had this problem with earlier versions. Some suggested putting the enviromnent-variable
definition into: ~/.MacOSX/environment.plist
I did that, so I am not sure if thats why it works.
Which version of the plugin are you using?
Dirk
One thing to bear in mind: The change Eugene referred to (implemented at r10647, 10 Sep) sets GRAILS_HOME for the spawned process to the Grails path entered in the plugin's config dialog. If you have gone to the trouble to set it by other means, it will be overwritten when you run your app. If the two settings are the same, then of course you won't notice. This provides a crude way to switch between different Grails version, as well as a backstop for people using systems like OSX that need extra initialisation for shells started by the display manager.