Gradle not on my path. After setting path and GRADLE_HOME it still tries to download it every time

The administrators at my employer installed Gradle in a strange spot (it’s not on my path by default). So I added the gradle/bin it to my path and then tried setting GRADLE_HOME and neither seemed to work. Every time I invoke gradlew it tries to download gradle 6.5. Since the machine is not on the internet, it is unable to be downloaded. How can I tell it to use the one where it is already installed?

gradlew is the Gradle Wrapper, it installs and uses its own distributions of Gradle which are downloaded as needed. If you wish to use your own installation of Gradle and it’s on the path, simply run gradle instead.

NOTE: The intent behind the Gradle Wrapper is that the build dictates the version of Gradle to be used so that it can control compatibility. If the build script uses functionality incompatible with the version of Gradle you have installed it will likely fail.

Thanks, that explains that. I hope it’s okay if I ask a follow up:

So I originally built my sandbox on my personal PC at home. There I can let gradle download whatever it want and it was easy to get to work. I do not have that luxury where I’m currently trying to get it to build. It is currently stuck on junit 4.13 (specifically it’s trying to find a file called junit-4.13.pom. Indeed I am unable to find that file manually, but I do see a junit-4.13.jar within the gradle-6.5/lib/plugins directory. So it seems it has come with my copy junit-4.12 within gradle, but doesn’t contain all the necessary files. Why is that?

And in case it’s useful, within my dependencies section I have the following line:

testImplementation ‘junit:junit:4.13’

Dependencies declared within the build script form the classpaths used for java compilation and runtime (for both the production and test code). The jars bundled with Gradle do not participate in this. Instead, in addition to declaring dependencies, the build also declares the repositories that Gradle can use to resolve those dependencies. If the build has been configured with remote repositories on the internet then the build will not function without internet access.

Are you trying to build a project that you own, or is it a third-party project that you are transferring to this no-internet environment?