Run Groovy without Installing it

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

On 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 .cmd file.

Run this file before invoking .groovy scripts in the same command prompt.

Now, verify java and groovy works.


Create a .groovy file.

Run it:


Karl San Gabriel

Karl San Gabriel

Java and Enterprise Technologies Expert