This message was deleted.
# community-support
s
This message was deleted.
🧵 1
v
Please do not split topics across several threads. This makes following the conversation in the threads view very hard as the context of the other messages is missing. If you have additional information either edit the original message or post to its thread. Regarding the problem, what exactly is unclear with the help you find at the link the error message provided? What did you try that does not work? Btw. my personal recommendation is, use the Kotlin DSL, not the Groovy DSL. You immediately gain type-safe build scripts, much better error messages if you mess up the syntax, amazingly better IDE support if you use a proper IDE like IntelliJ, ...
s
Apologies it’s my first time using Slack. Regarding the actual problem is that the during compiling Java reports an error on the build.file. I have checked the settings, and under compiler the correct Java package is installed. I want to push the build file into the nexus repository, but before I can do that I must successfully have an output that says ‘BUILD SUCCESSFUL’
v
Yes, I can see that. But the error message is quite verbose and clear. Did you read it? It even directly gives you the two alternatives that you could do to fix this, and for one of them even provides a link with further information.
s
Hi Vampire
Thank you very much. I correct the URL and I am faced with another problem. The compiler cannot find the tools.jar in the following folder. /usr/lib/jvm/java-8-openjdk-amd64 for a valid JDK installation.
v
What is the exact error, including
--stacktrace
?
Also usually better open a new thread for a new question 😉
s
Oh I’m very sorry Mr Vampire. Should we continue this on a new thread ?!
v
I've seen you already created it and also already got the solution 🙂
s
I wish did, I still have the error message that compiler cannot find tools.jar file
v
And you were told why. Either you use a JRE instead of a JDK which is required, or your JDK installation is broken. Use a JDK to run Gradle and the error will go away.
s
It’s due to an incomplete JDK installation. Please accept my apologies I’m learning and I want to learn so much. I did tried installing JDK I still get the same error
v
Maybe you installed it, but don't use it. If you run from commandline, make sure
JAVA_HOME
points to the correct installation, if you run from IntelliJ, make sure the correct installation is selected in the Gradle settings dialogue.
s
I have set the env JAVA_HOME to point to the correct installation path and I still get the same error. Other than command line Java -version any other ways to find out if the JDK is actually installed ?
v
If you installed the JDK, that installation contains the
tools.jar
, and it still complains about the other path not containing
tools.jar
, Gradle is obviously still not using that installation. What did you set
JAVA_HOME
to?
s
Using the export command this js what I did export JAVA_HOME= /usr/lib/jvm/java-8-openjdk-amd64
v
But you said, that this one does not contain the
tools.jar
s
That’s correct. I followed a set of instruction that suggested I do the above steps, unless i misunderstood the instruction. Would I need find where the location of the file is using the grep command then point it to that
v
You need to use a JDK, not a JRE. Install a JDK and then point the environment variable to that.
s
I have installed a JDK as you can see from the output
v
OpenJDK is the project name. You can have an OpenJDK JDK, or you can have an OpenJDK JRE as in your case. Thats just a slight confusing naming.
s
Is this JDK you are referring to ?
v
My crystal ball is in repair shop, so I don't know what is in that file, but as it is called
jdk
it could well be, yes. But make sure you are using a Gradle version that is compatible to run on Java 19 if you want to use that: https://docs.gradle.org/current/userguide/compatibility.html
s
Lol that’s funny.
Morning Mr Vampire I have managed to sort it thanks to your advice. The issue I had was two folds, firstly failing to understand exactly what you meant to have JDK after watching several different YouTube videos I decided to purge all versions of Java. To my horror here was seven Java installed. Removed everyone then did a clean install updated the /etc/environment and then updated and ran ./gradlew it was successful
👌 1
I feel chuffed. I’m happy to write an article and credits will go to you Vampire
❤️ 1
Thank you for all your help
👌 1