title: Select version of Gradle using Macports?
body: <p>I'm working on a project at the moment which is only compatible with Gradle 3.5. You can see below that I'm running Gradle 4.0 at the moment and would like to downgrade, preferably whilst continuing to use Macports to manage the install.</p>
  
  <p>The question is, <strong>how can I choose to use <code>gradle @3.5_0</code>?</strong></p>
  
  <hr>
  
  <p>My first port of call was to uninstall Gradle and re-install using an alternate means. When uninstalling (below) I spotted that I do have Gradle 3.5, I just need to activate it.</p>
  
  <pre><code>matt@macbook ~ $ sudo port uninstall gradle
  Password:
  The following versions of gradle are currently installed:
   1) gradle @3.2.1_0
   2) gradle @3.3_0
   3) gradle @3.5_0
   4) gradle @4.0_0
   5) gradle @4.0.1_0 (active)
  Enter option(s) [1-5/all]: 4
  ---&gt;  Uninstalling gradle @4.0_0
  </code></pre>
  
  <hr>
  
  <p>The standard Macports way to do that is to use <code>select</code>, but that didn't work, as below:</p>
  
  <pre><code>matt@macbook ~ $ port select gradle @3.5_0
  Selecting '@3.5_0' for 'gradle' failed: The specified group 'gradle' does not exist.
  </code></pre>
  
  <hr>
  
  <p>The <code>select</code> command relies on Macports being aware that multiple versions exist and can be selected. According to Macports, no such list exists for Gradle, as below:</p>
  
  <pre><code>matt@viking ~ $ port select gradle
  Warning: Unable to get active selected version: The specified group 'gradle' does not exist.
  Error: The 'list' command failed: The specified group 'gradle' does not exist.
  </code></pre>
  
  <hr>