This post demonstrates how to temporarily configure
Groovy to run in Windows. This is useful when we are unable to add or modify environment variables is
Windows due to restrictions.
Stuff used in this post.
- Windows 10 Enterprise
- current user has no permissions to add new environment variables
- Java 8 JDK
- Pre-installed or installed when we had temporary permissions to install it
- Apache Groovy 2.4.9
- Downloaded as zip and extracted to some local folder.
On Windows Command Prompt
Windows Command Prompt, it is possible to create and use environment variables for that command-line window only. When we open another
Windows Command Prompt, we need to create those environment variables again.
To avoid manually creating these environment variables every time we open a new command prompt, put the following commands in a executable
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_101
set PATH=%PATH%;C:\Program Files\Java\jdk1.8.0_101\bin
Run this file before invoking
.groovy scripts in the same command prompt.