• 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
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Grails class location in Windows

 
Ranch Hand
Posts: 164
  • 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: 164
  • 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!
 
World domination requires a hollowed out volcano with good submarine access. Tiny ads are optional.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic