Search This Blog

Breaking

Tuesday, 18 May 2021

How to configure groovy in Mac Intelij?

When I did the groovy set up on a windows machine, I never thought I would like an article about the same [How to configure groovy in Mac intelij] when I will do it in mac. The reason is obvious: It's not straightforward in mac. So let me share the steps which I followed to install groovy in mac:

1. You can make sure you have  brew (Homebrew) installed in your mac. To check this, You can run thsi command in the terminal:

brew --version

If it returns something like:

Homebrew 3.1.7

It means you have brew installed in your mac.


2. If the above command says, the brew is not found/recognized, it means you have to install it.

You can open this site:

https://brew.sh/

And inside that, you will see, Install homebrew.


Copy the command and paste it to the terminal and run it.


It will take some time, but it will install brew in your mac.


3. Once homebrew is in your machine, you can install groovy with this command in terminal:


brew install groovy


4. Once groovy will be installed in your machine, you can check it by running this command:


groovy --version


5. Now open IntelliJ for creating a new groovy project. It will ask you to do the setup the groovy library for groovy.

6. To give the path of the groovy library in IntelliJ, first, we will have to know the path of groovy installation in our machine. We can check the path of groovy installation with the help of the below command:

where groovy


in my case, the above command gave below path:


/usr/local/bin/groovy



7. Now the problem comes in mac. Because when you click on create in IntelliJ for setting up the library:

First, you can not figure out this path
Second, after figuring out also, you can not figure out the lib folder which needs to add in IntelliJ.

8. So if your groovy path is also the same as mine, you first need to navigate to this location.
This will be inside your  Mac folder, not in users.


9. After figuring out groovy in your mac, you need to find out the lib folder. Because in IntelliJ, the lib folder needs to be added. This can be found inside the groovy folder.




10.  Now add it in IntelliJ.







It will add now.

Note: To run groovy, you must have java also configured.
















No comments:

Post a Comment