What determines the location of the .grails directory? - grails

I want to change the location of the .grails directory. I have read about using working directories, but this is not what I want. For some reason my .grails directory gets put in the "Administrator" user folder instead of in my user folder. How do I correct this?

The grailsWorkDir property controls the location. You can change the value in the BuildConfig.groovy file.
See the Grails documentation section 5.5 Customising the build:
There is an issue with Java and the user.home property in Windows. See this SO question for more details:
Java user.home is being set to %userprofile% and not being resolved

On Windows 7, the values in the registry for "Shell Folders" AND "User Shell Folders" in the registry path "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer" affect the user.home and in turn the location of the ".grails" folder.

Try to setup the user.home JVM arg correctly on windows environment

Related

not able to locate gradle.properties in toolbox

I'm trying to run ./gradlew build command, which has artifactory_contextUrl property used in build.gradle file.
gradlew.properties is located in C:\Users\XXX.gradle folder, when I build the project in windows Intellij it takes the gradle.properties file in user folder and so gets the contexturl and everything is fine but,
when I try to build the project in docker toolbox it couldnt find it.
Toolbox starts with some location in C folder.
I tried with placing gradle.properties at the same level as build.gradle it works fine in toolbox. Eventually I dont want to keep the gradle.properties at buils.gradle level
What should I do? Does any one has any suggestions?
Well, I guess the docker toolbox (whatever it is, I don't know it) does run with another user account and thus does not find your gradle.properties file in your user directory.
The file is actually called gradle.properties, isn't it? In your question you use gradlew.properties and gradle.properties and only the latter is valid.
To solve your problem you can either make sure the gradle.properties is also in the users home directory that is used in the docker toolbox. To find out which directory this is, you can run Gradle with -d and search for Gradle user home, there it tells you which directory is the one where the gradle.properties is expected.
Alternatively you can use -P artifactory_contextUrl=asdf to set the property from the commandline, or use the system property org.gradle.project.artifactory_contextUrl or environment variable ORG_GRADLE_PROJECT_artifactory_contextUrl to set the project property.

Jenkins: Changing default log files location in windows

I need to change the location of log files of jenkins outside of jenkins home(installation) directory. I checked in jenkins.xml file but did not found any parameter to set.
Gone through some articles but they suggest to create symlinks.
Please let suggest if anyone already did it.
You can change the log location by changing the default location for the logs in %JENKINS_HOME%/jenkins.xml. By default the logs get stored at %JENKINS_HOME%/jenkins.out and %JENKINS_HOME%/jenkins.err.

Java windows command

I am trying to compile some java code on Windows 7 pc, I have installed java JDK and I am trying to use the javac command in cmd but I get output saying that
'javac' is not recognized as an internal or external command,
operable program or batch file.
What do I have to do to enable compiler in cmd or is it possible to do in Windows?
1)Go to properties by right click on icon Computer , then navigate to Advanced System Settings.
2)Click Environment Variables.
3)Click on New , set Variable name as path and Variable path as the path of java jdk installation directory which could be something like this -
C:\Program Files\Java\jdk1.6.0_23\bin;
where C:** is the drive where JDK is installed and **Program Files\java is the directory where it resides.
look out for semi-colon(;) at the last.
4)Click ok
5)Restart cmd and run javac , it should work now.
Look for Screenshots here for more help.
Regards
Anshul
you have to set a new system variable for your JAVA_HOME in windows.
See here for further information.
Add the path to bin folder of JDK in your PATH variable. For instructions to set PATH variable follow this tutorial.
Your java directory is not on the path. Here are some helpful screenshots to show how to set it up:
http://vietpad.sourceforge.net/javaonwindows.html

Cannot run Grails from command prompt

I’ve added a GRAILS_HOME environment variable, which points to the folder in which I extracted the Grails distribution zip, and I’ve added %GRAILS_HOME%\bin to my path. Yet after I open a new command prompt, the “grails” command is still not found. Does anyone have any clue as to why this is happening?
I’m running Grails 2.2 on Windows 7.
I have the same problem on Windows 7 64 bit and Grails version 2.*
By removing local neither maven repository nor installed plugins repository doesn't help.
I found - just set properties of %GRAILS_HOME%/bin/grails.bat and startGrails.bat as Run in compatibility mode: Windows XP (Service Pack 3).
To do that You need to have local PC Administrators rights.
/igors
have you create JAVA_HOME in there?
Maybe you are experiencing [STS-2530] Problem deploying Grails App if workspace path has a space. Jira shows the issue as resolved but it would not hurt to check that you do not have a space in your workspace path as it my trip up grails.
Do the following.
Go to your command prompt, execute the Path command. If everything has been set right your paths should show up as complete paths starting with C:... If the paths show up with the % sign that means your paths need to be set correctly. I did noticed that in your example you have used the forward slash - I am assuming that is a typo, because that will be a problem.
Another way to trouble shoot the issue is CD to the location C:\Grails\bin, execute the command grails.bat, if it executes you are in a good place that means you have to tweak your paths - following this path might give you a clue about other issues....
You might want to check the bin folder of your grails installation. The grails.bat file could be missing. I had this problem today and solved it by downloading the zip file again.

Add JAVA_HOME and JAVA_HOME/bin in your environment variable

I have extracted this from the book called
Rhomobile Beginner's Guide
Abhishek Nalwaya
Published Jul 2011
on page 18 it says:
Add JAVA_HOME and JAVA_HOME/bin in your environment variable, PATH.
To add this in PATH click on Environment Variables in Advanced Tab of System Property.
Select Path in System variables and add JAVA_HOME and JAVA_HOME/bin to textbox and click Ok.
What should be the value?
It will let you and other applications run Java tools without having to type the whole path.
I disagree about adding JAVA_HOME; I only have JAVA_HOME/bin in my PATH.
Tomcat requires that JAVA_HOME be set properly in order to operate; so do some other Java EE app servers. (I believe WebLogic needs it.)
The value should be the install directory for your JRE or JDK,
Browse your 'program files' folder for a java folder, should look something like:
C:\Progra~1\Java\jdk1.6.xx\
There will be a directory called bin inside it.

Resources