Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find gradle path on Ubuntu

I have gradle installed on my Ubuntu 15.10 System.I want to find the location where it is.
I am following this article. Here it is given that sample program can be found at samples/java/quickstart.
I want to open this sample program and for this I want to find location of gradle on my system, which I have downloaded from the official gradle site, and installed using ubuntu terminal.

like image 907
user3512178 Avatar asked Jul 04 '16 11:07

user3512178


People also ask

How do I find the Gradle path?

How to configure Android Studio. Open Preferences -> Build, Execution, Deployment -> Gradle . Select Use local gradle distribution and specify Gradle home . On Mac: /usr/local/opt/gradle/libexec in case you installed it via brew .

Where is .Gradle folder in Linux?

Regarding the ~/. gradle : it is the GRADLE_USER_HOME (by default USER_HOME/. gradle) : it can be redefined in multiple ways (see here) and it is used as soon as a gradle process is started. A gradle process is started as soon as you run a command starting with gradle <with args> in a directory where a build.

How do I know if Gradle is installed Ubuntu?

Verify Gradle Installation. Now open the command prompt. In the command prompt, enter Gradle -version. It will display the current version of Gradle just installed on the screen.


3 Answers

There's multiple ways to locate where gradle is actually installed on your computer :

  • locate : will locate where the bin gradle is on your computer. Assuming, gradle is on your PATH. It will most likely locate gradle in /usr/bin or /usr/share directory. If it locates the symbolic link use either ls -l or readlink to see where the bin is actually located.
  • which : similar as locate
  • find : to use at end if neither locate neigher which worked. It's the "brutal" way. You can use find / -name "gradle" 2> /dev/null to find all occurence of gradle (exact match) on your computer.
like image 192
Mickael Avatar answered Sep 28 '22 04:09

Mickael


/usr/lib/gradle/default -> /usr/lib/gradle/5.x.x the former is a link file targeted to actual directory which is the version you currently using.

apt install gradle in Ubuntu 18.10


which will locate to /usr/bin/gradle which is gradle start up script.

like image 23
NanoNova Avatar answered Sep 28 '22 04:09

NanoNova


Ubuntu 20.04.3 LTS in WSL2 in Windows 10 Pro (10.0.19043 N/A Build 19043):

$ sudo apt install gradle

$ which gradle
/usr/bin/gradle

$ readlink -f /usr/bin/gradle
/usr/share/gradle/bin/gradle

$ gradle --version
Gradle 4.4.1
Groovy:       2.4.17
like image 21
Vadzim Avatar answered Sep 28 '22 05:09

Vadzim