Traccar server on Raspberry Pi 4

gijssenha year ago

Hi, I have been struggling several weeks to install Traccar on my Raspberry PI Zero. The most recent version I succeeded to install and run is this one: traccar-linux-arm-4.10.zip. With version traccar-linux-arm-5.0.zip (and more recent versions). I get the following error when launching java -jar tracker-server.jar conf/traccar.xml

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/traccar/Main has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:756)

As I understood from online info I should install a more recent version of the Java Runtime.
Although it seems I have the most recent version ... :

sudo apt install default-jre
Reading package lists... Done
Building dependency tree
Reading state information... Done
default-jre is already the newest version (2:1.11-71+b2).
default-jre set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

When running "java -version" I get:

openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-8u312-b07-1~deb9u1-b07)
OpenJDK Client VM (build 25.312-b07, mixed mode)

And when running sudo update-alternatives --config java I get:

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-11-openjdk-armhf/bin/java      1111      auto mode
  1            /usr/lib/jvm/java-11-openjdk-armhf/bin/java      1111      manual mode
* 2            /usr/lib/jvm/java-8-openjdk-armhf/jre/bin/java   1081      manual mode

When I choose version "0" I get the following error when trying to start Traccar:

Error occurred during initialization of VM
Server VM is only supported on ARMv7+ VFP

Can you help me how to proceed to get the correct Java Runtime installed an to get Traccar runnning?

Thanks in advance,
Herman

Raoula year ago

I have used Linux Ubuntu on my Raspberry Pi. My experience was that it was necessary to install first Ubuntu, especially wit all its software updates, before installing Traccar. It went wrong when Ubuntu was not fully, fully updated.

chrisea year ago

I finally gave up and went to windows 10, works fine on a cheap second hand thinkcentre, all in all cheaper than using a pi and better interfaces already to plug in.

Anton Tananaeva year ago

Linux installation package already comes with Java. Why are you trying to run it manually? Just follow the instructions and it should work.

gijssenha year ago

I restarted from a fresh installation (no java on the Raspberry Pi Zero) and performed the following commands with success:

sudo wget https://github.com/traccar/traccar/releases/download/v5.12/traccar-linux-arm-5.12.zip
sudo unzip traccar-linux-arm-5.12.zip
sudo ./traccar.run
sudo systemctl start traccar

When launching the command "java -jar tracker-server.jar conf/traccar.xml"
I get the message:

-bash: java: command not found

There is a java in /opt/traccar/jre/bin/ but when launching the command "/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml" i get the error:

Segmentation fault

Am I missing something?

Thanks

Herman

Anton Tananaeva year ago

If you get a segmentation fault running java, it means something is very wrong. Either you're not using the right architecture or something is just broken. What architecture and OS are you using?

gijssenha year ago

I'm using a Raspberry Pi Zero with OS:

cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

I used the installation file traccar-linux-arm-5.12.zip

Anton Tananaeva year ago

I suspect you do have to install and use the system version of Java.