Gradle installation

table of contents

Introduction

This is a record of Gradle setup failures and successes that I wrote down when using Java for the first time. (2018.02)

Java settings

Set Java as a prerequisite for Gradle operation.

JAVA_HOME settings

C:\Users\user>set JAVA_HOME="C:\Program Files\Java\jdk1.8.0_161\bin"

Java version check

C:\Users\user>java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) Client VM (build 25.161-b12, mixed mode, sharing)

Gradle installation

Download and unpack Gradle

  1. Download from the official website  https://gradle.org/

  2. Unzip to a suitable folder

PATH setting

Set the path of the folder where you unzipped Gradle

C:\Users\user>set PATH=%PATH%;C:\tmp\gradle-4.5.1\bin

Gradle version check (failure)

C:\Users\user>gradle -v

ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk1.8.0_161\bin

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

JAVA_HOME setting (re)

C:\Users\user>set JAVA_HOME="C:\Program Files\Java\jdk1.8.0_161"

Gradle version check (success)

C:\Users\user>gradle -v

------------------------------------------------------------
Gradle 4.5.1
------------------------------------------------------------

Build time:   2018-02-05 13:22:49 UTC
Revision:     37007e1c012001ff09973e0bd095139239ecd3b3

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          1.8.0_161 (Oracle Corporation 25.161-b12)
OS:           Windows 7 6.1 x86

Recommended Posts

Gradle installation
Wildfly installation
Gradle Memorandum
java installation
Gradle task definitions
Java installation jdk
Gradle Japanese translation
OpenJDK 11 installation memo
What is Gradle?
First CentOS 8 installation
iPLAss installation summary