• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Grails class location in Windows

 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I loaded grails on my windows machine at home. I used the instructions found in Scott Davis' book Groovy Recipes.
When I build and run my test app from its directory:

C:\grailsprojects\bookstore

I notice grails places my class files in this directory:

C:\Documents and Settings\Bob Reardon\.grails\1.0.4\projects\bookstore\classes.

Is this normal grails behavior or am I missing something ??
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that is standard Grails operation. Looking at the source code (grails_home/scripts/Init.groovy, line 55) it would appear that is you set the GrailsApplication.WORK_DIR system property that it will use that location instead. You can set this in grails_home/bin/startGrails.bat. For example, you could add the following line to the block of script statements that set JAVA_OPTS:

set JAVA_OPTS=%JAVA_OPTS% -DGrailsApplication.WORK_DIR=C:\some\other\dir

I have not tried it, so no guarantees that it will work...
 
Bob Reardon
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Peter,

I tried your suggestion, but was unable to change the working directory for my Grails application. The grails app works, it just suprised me to see the class files saved to a different location.

Thanks for your help.

-Bob
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In case you are still looking. The System Property isn't GrailsApplication.WORK_DIR that is a variable pointing to the correct property name. The correct property name is grails.work.dir so your startGrails.bat will include this line:

set JAVA_OPTS = %JAVA_OPTS -Dgrails.work.dir=\path\for\you

Hope that helps

Chris
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How embarrassing - I copied and pasted the field name, not the system property name!

Oh. and welcome to Java Ranch, Chris!
 
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!