Question

For me to manually install tools like Groovy, Grails, Gradle, etc. on Windows, I need to set up a new env var (i.e. GROOVY_HOME) and then add that tool's bin directory to the system Path (i.e. %GROOVY_HOME%\bin), etc.

My understanding of GVM is that it allows you to have multiple versions of all these tools on your OS at any given point in time. But how is this possible with respect to the fact that the env vars must exist (and must point to a specific version) for these tools to run?

Was it helpful?

Solution

GVM uses symbolic links to change the current version of Groovy, Grails etc. Specifically, there is a symlink

~/.gvm/grails/current

If the current version of Grails is 2.3.5 this symlink points to

~/.gvm/grails/2.3.5

if you run gvm use grails 2.3.6 GVM changes the symlink to point to

~/.gvm/grails/2.3.6

So the GRAILS_HOME env var is always pointing at ~/.gvm/grails/current, but the target of this symlink changes when you run GVM commands.

The Windows filesystem doesn't support symlinks, which is why GVM doesn't work on Windows (though you might be able to run it under Cygwin).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top