traccar 6.4 on rpi 64bit

bristol4063 months ago

I'm trying to install traccar 6.4 on 64bit Rasbian Pi 4.0 using traccar-linux-arm-6.4.zip. When I run the install, traccar fails to start and there is no log file created. If I try to run it manually using:

sudo java -jar /opt/traccar/tracker-server.jar /opt/traccar/conf/traccar.xml

I get the following error message:

Error: LinkageError occurred while loading main class org.traccar.Main
        java.lang.UnsupportedClassVersionError: org/traccar/Main has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

My java version is:

openjdk version "11.0.23" 2024-04-16
OpenJDK Runtime Environment (build 11.0.23+9-post-Raspbian-1deb11u1)
OpenJDK Server VM (build 11.0.23+9-post-Raspbian-1deb11u1, mixed mode)

Do I need a different java version and if so what version works with traccar 6.4

Any advice appreciated.

Anton Tananaev3 months ago
odhiambo3 months ago

I installed it just now on Pi4B:

root@RPi4B8GB:/etc/apt/sources.list.d# systemctl status traccar
● traccar.service - traccar
     Loaded: loaded (/etc/systemd/system/traccar.service; enabled; preset: enabled)
     Active: active (running) since Thu 2024-08-15 17:19:03 EAT; 14s ago
   Main PID: 46436 (java)
      Tasks: 24 (limit: 8730)
     CGroup: /system.slice/traccar.service
             └─46436 /opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml

Aug 15 17:19:03 RPi4B8GB systemd[1]: Started traccar.service - traccar.
root@RPi4B8GB:/etc/apt/sources.list.d# systemctl status traccar
● traccar.service - traccar
     Loaded: loaded (/etc/systemd/system/traccar.service; enabled; preset: enabled)
     Active: active (running) since Thu 2024-08-15 17:19:03 EAT; 20s ago
   Main PID: 46436 (java)
      Tasks: 27 (limit: 8730)
     CGroup: /system.slice/traccar.service
             └─46436 /opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml

Aug 15 17:19:03 RPi4B8GB systemd[1]: Started traccar.service - traccar.
Aug 15 17:19:22 RPi4B8GB traccar[46436]: Database is up to date, no changesets to execute
Aug 15 17:19:22 RPi4B8GB traccar[46436]: UPDATE SUMMARY
Aug 15 17:19:22 RPi4B8GB traccar[46436]: Run:                          0
Aug 15 17:19:22 RPi4B8GB traccar[46436]: Previously run:              49
Aug 15 17:19:22 RPi4B8GB traccar[46436]: Filtered out:                 0
Aug 15 17:19:22 RPi4B8GB traccar[46436]: -------------------------------
Aug 15 17:19:22 RPi4B8GB traccar[46436]: Total change sets:           49
root@RPi4B8GB:/etc/apt/sources.list.d# lsof -i -P -n | grep '8082\|5055'
java      46436            root  468u  IPv6 6449899      0t0  TCP *:5055 (LISTEN)
java      46436            root  588u  IPv6 6453320      0t0  TCP 172.16.17.102:8082 (LISTEN)
root@RPi4B8GB:/etc/apt/sources.list.d# java -version
openjdk version "17.0.12" 2024-07-16
OpenJDK Runtime Environment (build 17.0.12+7-Debian-2deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.12+7-Debian-2deb12u1, mixed mode, sharing)

So here is the deal:

  1. Stick with the default version: sudo apt install default-jre

You may need the JDK in addition to the JRE in order to compile and run some specific Java-based software. To install the JDK, execute the following command, which will also install the JRE:
sudo apt install default-jdk

tc.wash.lan.png

Rodney Yeo3 months ago

You need Java version 21 wihich already comes bundled with every version of TracCar. Uninstall the Java 17 which is from Rasberry Pi Official repository. Also you need to run TracCar service as root user not sudoer user. Else you get into lots of errors. Trust me I have gone thru that Hell stages previously.

odhiambo3 months ago

@Rodney, this is well noted. I see that traccar comes self-contained :)

Rodney Yeo3 months ago

I am running my private TracCar server on RasPi 64 bit latest Bookworm version but uses TracCar Java binary instead for ease of deployment on RasPi 3B+ unit. Else lots of Java errors from other flavours of JAVA versions out there.

Rodney Yeo3 months ago

Something you need to take note before any upgrade is that you must "systemctl stop traccar" service first only then you can run "./traccar.run" else your setup or upgrade will failed prematurely.

Then only you can "systemctl start traccar" service back up again. Verify after one minutes if the TracCar service is running with report on any patch module applied repirted.

Run "systemctl status traccar" good luck learning and mastering great TracCar app by our dearest developer guru, many thank to him and his team contribution to society ... :)

Best to remember to use MySQL or MariaDB Database for production environment else you will regrette it once your RasPi power outage and it will be dead ... RIP TracCar server!

bristol4063 months ago

I've now installed java 17 on my Pi 4b which seems to solve the java version issue. However, when I re-install traccar and start the service I get the following error:
pi@home-server:/opt/traccar $ sudo systemctl status traccar

* traccar.service - traccar
     Loaded: loaded (/etc/systemd/system/traccar.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Thu 2024-08-15 21:09:33 BST; 1s ago
    Process: 12843 ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml (code=exited, status=203/EXEC)
   Main PID: 12843 (code=exited, status=203/EXEC)
        CPU: 2ms

Aug 15 21:09:43 home-server systemd[1]: traccar.service: Scheduled restart job, restart counter is at 41.
Aug 15 21:09:43 home-server systemd[1]: Stopped traccar.
Aug 15 21:09:43 home-server systemd[1]: Started traccar.
Aug 15 21:09:43 home-server systemd[12858]: traccar.service: Failed to execute /opt/traccar/jre/bin/java: No such file or directory
Aug 15 21:09:43 home-server systemd[12858]: traccar.service: Failed at step EXEC spawning /opt/traccar/jre/bin/java: No such file or directory
Aug 15 21:09:43 home-server systemd[1]: traccar.service: Main process exited, code=exited, status=203/EXEC
Aug 15 21:09:43 home-server systemd[1]: traccar.service: Failed with result 'exit-code'.
pi@home-server:/opt/traccar $

Not sure which file is missing. /opt/traccar/jre/bin/java does seem to exist.
pi@home-server:/opt/traccar/jre/bin $ ls
java jrunscript keytool rmiregistry

Have I missed something ?

bristol4063 months ago

Update: It works when I start traccar manually !

Anton Tananaev3 months ago

You're probably using the wrong CPU architecture.

bristol4063 months ago

I'm running on Pi 4 b with 64bit Raspbian OS. It previously ran traccar 4.15

Anton Tananaev3 months ago

Are you sure it's AArch64? We dropped support for 32 bit ARMs recently.

Rodney Yeo3 months ago

You might want to upgrade to 6.2 and stop there onwards. Cause Google Map is no longer available unless you pay for it with API keys purchases from 6.3 onwards up.

Anton Tananaev3 months ago

Just to clarify, Google Maps service was never free. You could just use it illegally without any license previously. Now it is easier use it legally with a proper key.

bristol4063 months ago

Output from uname -m is aarch64