Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Why is gradle unable to access jarfile build?


Asked by Ethan Frederick on Nov 30, 2021 Gradle



./gradlew build && java -jar build/libs/gs-spring-boot-0.1.0.jar the build fails with the above error. There is message before the failure that says: Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Moreover,
Before we begin explaining the process of adding local JAR files to Gradle, it's good to mention that it is not recommended to manually add the dependencies that are available in the public repositories. One of the most important reasons why build systems like Gradle exist is to do this sort of thing automatically.
Likewise, A Gradle project describes its build in a file called build.gradle located in the root folder of the project. (See Gradle User Guide for an overview of the build system itself.) The most simple Android project has the following build.gradle: buildscript { ... } configures the code driving the build.
And,
The “gradle dependencies” task does not list any file dependencies. Even though you might think so, as they have been specified in the “dependencies” block after all.. So don’t rely on the output of this to check whether your referenced local lib files are working correctly.
Also Know,
What Causes the “Unable to Access Jarfile” Error 1. The latest Java version has not been installed on your computer. 2. The file path set for the Java executable is incorrect and points to the wrong location. 3. The default program for opening JAR files is not set. 4. Malware is on your computer.