I found this post but the answer did not solve my problem. The answers only address windows systems and provide file paths which are not helpful for the OS I am running. I am running openSUSE Leap 15 with Java 1.8, changing the OS or Java version is not an option.
When I try to build with the command ./gradlew clean build
i get the following error:
:buildtools:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':buildtools:compileJava'.
> Could not find tools.jar. Please check that /usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre contains a valid JDK installation.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 15.364 secs
I have checked my Java installation like this:
$> rpm -qa | grep java
javapackages-tools-5.0.0+git20180104.9367c8f6-lp150.1.2.x86_64
timezone-java-2018g-lp150.2.13.1.noarch
java-1_8_0-openjdk-1.8.0.181-lp150.2.6.1.x86_64
libjavascriptcoregtk-4_0-18-2.20.5-lp150.2.6.1.x86_64
java-1_8_0-openjdk-headless-1.8.0.181-lp150.2.6.1.x86_64
I also checked out JAVA_HOME:
$> echo $JAVA_HOME
/usr/lib64/jvm/jre-1.8.0-openjdk