How do I check Grails is installed on a Mac OS? - macos

I installed Grails on a Mac OS using the gvm.
I did:
gvm install grails version 2.2.1
I want to satisfy my paranoia and confirm grails is installed. Is there something like a grails -version equivalent?
Or what is the easiest way to check?

grails
or
grails --version
or
grails help

grails --version
More information can be found at grails.org

i agree to Fran García. just use gvm.
install gvm with
curl -s get.gvmtool.net | bash
then install grails with
gvm install grails 2.3.0
then you can check grails with
grails -version

just use :
$ gvm current grails
Using grails version 2.2.0
the cmd will show all the tools installed by gvm.
see the doc for more. http://gvmtool.net/

with following command you can locate where exactly grails is installed.
>which grails
>/Users/techtalks/.gvm/grails/2.4.0/bin/grails

grails --version
This should help you get the version of grails

If I am not wrong the problem is you need to install grails using gvm with the next command:
gvm install grails 2.2.1
Please note there is no version in the command

By just executing grails, it'll display the grails version anyway. But in order for grails to run or to give you its version with "grails --version" it needs to be in the path. On my mac, I have to open a new terminal in order to read the path after it is installed (or defaulted) by gvm. Maybe this is what's missing and you can't get the version

"grails -version" is the best way to check.
However, use the gvm framework to install/use different version of grails/ groovy/ gradle and other groovy based language.
This way, you could do a "gvm current grails" and see what is the version of grails you are using.
more info can be seen at http://gvmtool.net/

Also, if you have installed several grails, you can use:
gvm use grails --version
to change from one version to another.

The command
which grails
Will tell you if you have a grails distribution in your execution path.
The command
find / -iname *grails*
Will list all of your data whose name contains the 'grails' string (case insensitive).
Warning: while the former command is pretty quick, the latter could and probably will take a while to run.
Cheers,
Snoopy

Related

install maven 3.6.0 on Mac

I am trying to install a specific version of man.brew install maven#3.6.0 is not working due to lack of 3.6 version (there is 3.5, 3.2, 3.3). installation with this guide https://maven.apache.org/install.html also not.
zsh: man not found
Any ideas?
You can use Maven Version Manager to manage multiple versions of maven. You can have a folder-specific maven version.
Steps
If you already installed the maven brew formula uninstall it brew remove --force maven
Install mvnvm. brew install mvnvm
To set the global maven version add an environment variable named DEFAULT_MVN_VERSION with the maven version you want as default as the value.
To set a Maven version for a specific folder create a file named mvnvm.properties in that folder and have the following content.
mvn_version=<maven version for the folder>
You can get the 3.6.3 binaries from here
https://dlcdn.apache.org/maven/maven-3/3.6.3/
Just saw and struggled for a bit before getting to the wget command

dnvm can't find latest version from nuget.org

Going through the steps of setting up dnvm on OSX and I can't seem to get past the dnvm upgrade step as it's returning the error:
~$ dnvm upgrade
Determining latest version
Error: Could not find latest version from feed https://nuget.org/api/v2
I can install based off the unstable feed using -u however then I run into a whole new set of issues.
This actually is caused by dnvm not following a redirect to www.nuget.org (instead of without the www). It is fixed with the following line:
export DNX_FEED=https://www.nuget.org/api/v2
Hope that helps
The packages will be available soon:
https://github.com/aspnet/dnvm/issues/235

Install / upgrade gradle on Mac OS X

How do I install/upgrade gradle for Mac?
As mentioned in this tutorial, it's as simple as:
To install
brew install gradle
To upgrade
brew upgrade gradle
(using Homebrew of course)
Also see (finally) updated docs.
Another alternative is to use sdkman. An advantage of sdkman over brew is that many versions of gradle are supported. (brew only supports the latest version and 2.14.) To install sdkman execute:
curl -s "https://get.sdkman.io" | bash
Then follow the instructions. Go here for more installation information. Once sdkman is installed use the command:
sdk install gradle
Or to install a specific version:
sdk install gradle 2.2
Or use to use a specific installed version:
sdk use gradle 2.2
To see which versions are installed and available:
sdk list gradle
For more information go here.
And using ports:
port install gradle
Ports , tested on El Capitan
I had downloaded it from http://gradle.org/gradle-download/. I use Homebrew, but I missed installing gradle using it.
To save some MBs by downloading it over again using Homebrew, I symlinked the gradle binary from the downloaded (and extracted) zip archive in the /usr/local/bin/. This is the same place where Homebrew symlinks all other binaries.
cd /usr/local/bin/
ln -s ~/Downloads/gradle-2.12/bin/gradle
Now check whether it works or not:
gradle -v
Two Method
using homebrew auto install:
Steps:
brew install gradle
Pros and cons
Pros: easy
Cons: (probably) not latest version
manually install (for latest version):
Pros and cons
Pros: use your expected any (or latest) version
Cons: need self to do it
Steps
download latest version binary (gradle-6.0.1) from Gradle | Releases
unzip it (gradle-6.0.1-all.zip) and added gradle path into environment variable PATH
normally is edit and add following config into your startup script( ~/.bashrc or ~/.zshrc etc.):
export GRADLE_HOME=/path_to_your_gradle/gradle-6.0.1
export PATH=$GRADLE_HOME/bin:$PATH
some other basic note
Q: How to make PATH take effect immediately?
A: use source:
source ~/.bashrc
it will make/execute your .bashrc, so make PATH become your expected latest values, which include your added gradle path.
Q: How to check PATH is really take effect/working now?
A: use echo to see your added path in indeed in your PATH
➜ ~ echo $PATH
xxx:/Users/crifan/dev/dev_tool/java/gradle/gradle-6.0.1/bin:xxx
you can see we added /Users/crifan/dev/dev_tool/java/gradle/gradle-6.0.1/bin into your PATH
Q: How to verify gradle is installed correctly on my Mac ?
A: use which to make sure can find gradle
➜ ~ which gradle
/Users/crifan/dev/dev_tool/java/gradle/gradle-6.0.1/bin/gradle
AND to check and see gradle version
➜ ~ gradle --version
------------------------------------------------------------
Gradle 6.0.1
------------------------------------------------------------
Build time: 2019-11-18 20:25:01 UTC
Revision: fad121066a68c4701acd362daf4287a7c309a0f5
Kotlin: 1.3.50
Groovy: 2.5.8
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 1.8.0_112 (Oracle Corporation 25.112-b16)
OS: Mac OS X 10.14.6 x86_64
this means the (latest) gradle is correctly installed on your mac ^_^.
for more detail please refer my (Chinese) post 【已解决】mac中安装maven

How to find out what version of maven I am using

The following command in my terminal is not working (mac user)
mvn --version
I want to find out what version of maven I have. I know that I have maven because I use it all the time but I am wondering my this command is not working.
For mac user follow the below link:
http://coolestguidesontheplanet.com/installing-homebrew-os-x-yosemite-10-10-package-manager-unix-apps/
then after you follow those directions enter
brew install maven

Grails Mac OSX Install via Brew Restarting terminal

I've been trying to get past step one of installing grails, which is bad i know. But the issue im having is getting grails to work via the OSX terminal. similar to node using brew I type the command
brew install grails
this retrieves grails and installs it, simple. to see if its installed correctly you type grails -version
However when i do that it's as though my terminal restarts. Its a hard thing to describe so here is a link to a youtube video that shows you what happens. I have JAVA installed and working. Anyone have an idea?
https://www.youtube.com/watch?v=ButLwGfBTZo
As this is the first excursion I have had into any Java related development. I made a rookie mistake and was unaware of vital piece of information. You do not need Java to run Grails you need the Java Development Kit (JDK). Which is a different thing completely apparently.
Available here
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Once installed run this command in the terminal /usr/libexec/java_home -V This will show you all of the current Java Virtual Machines installed. In my case
Matching Java Virtual Machines (1):
1.8.0_11, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home
You then need to set your JAVA_HOME Environment variable to point to your JVM. Like so export JAVA_HOME=$(/usr/libexec/java_home) use /usr/libexec/java_home rather than the true location as this will specifi the version set in Java Preferences for the current user. The source for that nice little trick is here http://www.mkyong.com/java/how-to-set-java_home-environment-variable-on-mac-os-x/
Once you've done that you can type the command brew install grails or gvm install grails which is what i should probably use rather than brew as "SurrealAnalysis" rightly pointed out in one of the answers.
moment of truth grails -version and i got a response Grails version: 2.4.3... sweet.
Thank you all for the replies and help.
Following previous post, GVM it is not available in Homebrew, because of this.
GDK is also now officially SDKMAN!.
So, the steps would be:
curl -s "https://get.sdkman.io" | bash
source "/Users/{YOUR_USER_NAME}/.sdkman/bin/sdkman-init.sh"
sdk install groovy
Hope it helps! :)

Resources