Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gradle process command java finished with non-zero exit value 1

I am getting the following error when I type gradle bootRun --stacktrace --debug in the CentOS 7 terminal to use gradle to launch this sample spring boot app.

Caused by: org.gradle.process.internal.ExecException:  
Process 'command '/opt/jdk1.8.0_45/bin/java'' finished with  
non-zero exit value 1

I have googled this error and read other SO postings that are similar but not duplicates. For example, this is in eclipse in CentOS 7 and a web app. This is not an android app, etc. Also, commands given in other postings have not resolved this problem.

All of the code required to reproduce this problem is in the github link above, and all of the logs to diagnose the problem is in this OP below. How do I resolve this error so that I gradle bootRun can succussfully launch the sample app?


STEP BY STEP REPRODUCTION OF THE PROBLEM:


I downloaded the app as-is by navigating to /home/user/workspaces/ and typing git clone https://github.com/jrodenbostel/beyond-the-examples

I then navigated to cd /home/user/workspaces/beyond-the-examples/part-5 and typed gradle bootRun --stacktrace --debug, which resulted in the stack trace and logs that you can read by clicking on this link to a file sharing site. (The logs are too long to include in this OP.)

like image 503
CodeMed Avatar asked Aug 30 '25 18:08

CodeMed


1 Answers

This was my original error message:

enter image description here

Changing my %JAVA_HOME% in Window's Environmental Variables from Java 9 (file directory C:\Program Files\Java\jdk-9.0.1) to Java 8 (C:\Program Files\Java\jdk1.8.0_151) was what fixed it for me. You can figure out what path you set %JAVA_HOME% to by typing echo %JAVA_HOME% in Command Prompt.

So yea, as of 12-20-2017, gradle bootRun doesn't play well with Java 9. Hopefully that will be fixed soon and I can delete this answer.

like image 172
Gene Avatar answered Sep 02 '25 07:09

Gene