Build Traccar from source via Command Line method on Ubuntu Server 16.10

Amr Elsharqawi8 years ago

I will go for Command Line method, so we need Java and Maven & I assume that you have fresh ubuntu server installed check https://www.traccar.org/forums/topic/installing-traccar-v3-9-on-ubuntu-16-10-server-x84_x64-on-remote-vps-via-ssh/ for more info

$ sudo apt install default-jdk
$ sudo apt install maven

$ git clone https://github.com/tananaev/traccar.git
$ cd traccar
$ git clone https://github.com/tananaev/traccar-web.git

$ mvn package


$ cd ..
$ wget http://cdn.sencha.com/ext/gpl/ext-6.2.0-gpl.zip

$ unzip ext-6.2.0-gpl.zip

$ wget http://cdn.sencha.com/cmd/6.2.1/no-jre/SenchaCmd-6.2.1-linux-amd64.sh.zip

$ unzip SenchaCmd-6.2.1-linux-amd64.sh.zip

$ sudo ./SenchaCmd-6.2.1.29-linux-amd64.sh -q -dir /bin


$ cd PATH to /traccar/traccar-web/tools

$ ./minify.sh

$ cd ../../setup

$ wget https://excellmedia.dl.sourceforge.net/project/yajsw/yajsw/yajsw-stable-12.08/yajsw-stable-12.08.zip
$ wget https://mlaan2.home.xs4all.nl/ispack/innosetup-5.5.9.exe
$ sudo apt install wine-stable
$ sudo apt install innoextract
$ sudo apt install makeself
$ sudo apt install dos2unix

$ ./package.sh v3.9-latest

Now you've got the packages

copy traccar-linux-v3.9-latest.zip to your convenient directory and unzip it, then upgrade the current v3.9 to v3.9-latest.

Upgrade process is very simple:

  1. Make backup of the database
  2. Save any changes in the config file (if applicable)
  3. Remove old version of Traccar
  4. Install new version of Traccar
  5. Update config file (if applicable)
  6. Start Traccar service

Since we didn't change configurations & we didn't add data to current version "Simply"

$ unzip traccar-linux-v3.9-latest.zip
$ sudo ./traccar.run
$ sudo /opt/traccar/bin/startDaemon.sh
Anton Tananaev8 years ago

Thanks for sharing the information. I have added some formatting to make it more readable.

Olivier G8 years ago

Well I tried this last night sorry to tell but this is, hmm, quite complicated / not natural

Ext6 Senchacmd: had to Google / struggle

Wine / dos2unix.. Unexpected stuff for a Java project ?

If I missed a more recent documentation please correct

Thanks

Anton Tananaev8 years ago

Why are you trying to build an installer package?

There is official documentation:

https://www.traccar.org/build/

Hi Anton.

I'm trying to build Traccar from source in an Ubuntu 16.04

I have followed the instructions above and at the following command it seems that I'm missing a few java libraries:

./package.sh v4.2-latest

Would you please point me to the right direction of how to install for example the 'Missing Windows 64 Java' from:
https://github.com/ojdkbuild/ojdkbuild

Oh, and Merry Christmas!

chris@chris-unix:~/traccar/setup$ ./package.sh v4.2-latest
[INFO] Checking build requirements for platform: all
[ OK ] Traccar server archive
[ OK ] Traccar web interface
[ OK ] Zip
[ OK ] Unzip
[ OK ] Ext JS
[ OK ] Sencha Cmd
[ OK ] Jlink
[ OK ] Inno Extractor
[ OK ] Inno Setup
[WARN] Missing Windows 64 Java (https://github.com/ojdkbuild/ojdkbuild)
[ OK ] Wine
[ OK ] Makeself
[WARN] Missing Linux 64 Java (https://github.com/ojdkbuild/contrib_jdk10u-ci/releases)
[WARN] Missing Linux ARM Java (https://github.com/ojdkbuild/contrib_jdk10u-aarch32-ci/releases)
[INFO] Missing build requirements, aborting...
Anton Tananaev6 years ago

Why are you trying to build an installer? You probably don't need it.

I'm employed in a vehicle tracking company.
We are considering changing our software.
I'm looking for a platform flexible enough that can be adapted to our needs. I would like to setup a development environment and test a couple of changes in the web interface.

Thanks for responding.

Anton Tananaev6 years ago

You don't need to compile the whole installer. You just need to compile minified version of the app.

Done. Thanks Anton.
I have followed the support article below, installed locally and made a couple of changes.
https://www.traccar.org/build-in-intellij-idea/

I'd like to ask something else. Please tell me if it is OK to ask here or to open a different thread.
I have installed Traccar in DigitalOcean, following the article below:
https://www.traccar.org/install-digitalocean/

How do I apply the changes from my local dev environment to DigitalOcean?

Thanks for your time.

I have made some progress.

I changed my local Login.js file:
/home/chris/traccar/traccar-web/web/app/view/dialog/Login.js

I built the project using Intellij IDEA and I can see the changes.

I have uploaded via FTP the new and replaced the old Login.js in the online server:
/opt/traccar/web/app/view/dialog/Login.js

I don' t see the changes. I know that I should use "debug.html" to load the non-compressed version of the web interface but I don't know how to do this.
Thanks.

Anton Tananaev6 years ago

Just open "debug.html" in browser.

Done. Worked.
Easier than I thought...
Thanks!

Sreelakshmi K S6 years ago

when typed ./minify.sh
get error give below

Sencha Cmd v6.2.1.29
[ERR] Failed to resolve dependency Ext.app.Application for file Traccar.Application
[ERR] Unknown definition for dependency : Ext.app.Application
shajir@ubuntu-s-2vcpu-4gb-blr1-01-java:~/traccar/traccar-web/tools$

How to resolve this

Sreelakshmi K S6 years ago

resolved myself . missed to unzip sencha

Bil4 years ago

good morning
please if you could explain how to build with the modern web interface?
and while I run npm serve , the interface work but other option like settings etc. doesn't works
any help with that