Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile Groovy in VSCode

I've found the vscode-groovy extension that does the formatting and highlighting, but I'm really having trouble getting the compiler/debugger configured.

I figure I could just point JAVA_HOME to my Groovy compiler, but is there a better way to do this?

like image 421
jamzsabb Avatar asked Sep 20 '18 17:09

jamzsabb


1 Answers

I had the same problem, so I did the following steps:

  1. Installation of Groovy. Firstly, I've installed the latest stable pack from the Groovy website. This is basically downloading the pack and unzipping it to a certain local folder.
  2. Add Groovy bin to PATH variable. Just add the bin folder of the unzipped Groovy pack to the environment variable PATH.
  3. Install the Code Runner extension for Visual Studio Code. This extension can be downloaded from the VS marketplace. If this is done, then you can at least run the groovy script already. Just open the context menu of the file in the VS Code explorer and click Run code.

If you want to debug the script, then you should put it in a java class and debug it as described here.

like image 195
budul Avatar answered Sep 17 '22 12:09

budul