2

I am trying to initialize a Java application via Gradle Build Init Plugin, with command gradle init --type java-application, but I am getting the following error:

The requested build setup type 'java-application' is not supported. Supported types: 'basic', 'groovy-library', 'java-library', 'pom', 'scala-library'.

I have the version 3.1 of Gradle (which does not include java-application type).

So, I was wondering how can I update Gradle local installation, without having to remove it, download it and install it again?

1
  • > remove it, download it and install it again You have to do exactly this. Or just install another version alongside it. Feb 17, 2017 at 14:14

1 Answer 1

4

You may use Gradle Wrapper, which is the preferred way of starting a Gradle build. Follow these steps to use the right version of Gradle:

  1. Run gradle wrapper --gradle-version 3.3 to install the right version of Wrapper into your project folder.
  2. Henceforward use gradlew instead of gradle. The former uses your Gradle project installation (i.e. version 3.3), whereas the latter uses your computer home directory installation (i.e. version 3.1).
  3. Running gradlew -v returns Gradle 3.3 and gradle -v returns Gradle 3.1 in your case.
  4. Now, run gradlew init --type java-application to setup a command-line application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.