build error gradlew assemble

Manuel Suárez 4 years ago

Hi Anton, good afternoon, I am trying to create my .jar following the instructions in the documentation but I get an error for which I have found a solution online but when I look for the file tools.jar in both the java jre and java sdk folders, I can't find it , any ideas

> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Could not find tools.jar. Please check that C:\Program Files (x86)\Java\jre1.8.0_321 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.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
5 actionable tasks: 1 executed, 4 up-to-date
Anton Tananaev 4 years ago

Looks like some error with JDK. Do you actually have JDK installed and configured correctly? It looks like JRE.

Manuel Suárez 4 years ago

if so both installed JDK version 18 and 11, JRE 1.8.0_321

https://ibb.co/KL9yMfd

search for the error online as commented above and found that tools.jar no longer exists since java JRE 9

So far I haven't made any changes to the code, I'm just trying to create my own tracker-server.jar to later make the necessary modifications.

Anton Tananaev 4 years ago

That's why I said and configured correctly. Based on the output it looks like it's using JRE 1.8.

Manuel Suárez 4 years ago

Hello Anton, again you were right, the environment variables were misconfigured, it seems that I only have one doubt left. BUILD SUCCESSFUL sent me a message, I concluded that everything went well, but I cannot find the tracker-server.jar file, where is said file saved?

is this the correct location?

C:\Users\Manuel\Desktop\traccar\traccar\target
Microsoft Windows [Versión 10.0.19043.1586]
(c) Microsoft Corporation. Todos los derechos reservados.

C:\Users\Manuel\Desktop\traccar\traccar>gradlew assemble
Starting a Gradle Daemon, 3 incompatible and 1 stopped Daemons could not be reused, use --status for details

> Task :compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

BUILD SUCCESSFUL in 1m 29s
7 actionable tasks: 3 executed, 4 up-to-date
C:\Users\Manuel\Desktop\traccar\traccar>
Anton Tananaev 4 years ago

It should be in the target folder.

Manuel Suárez 4 years ago

thanks Anton as always a great support greetings and encouragement with the project that is great