When I run it on Netbeans everything works and the console shows these commands:
cd D:\Users\username\Desktop\traccar; "JAVA_HOME=C:\Program Files\Java\jdk1.8.0_51" cmd /c """C:\Program Files\NetBeans 8.2\java\maven\bin\mvn.bat" -Dexec.args="-classpath %classpath org.traccar.Main debug.xml" -Dexec.executable="C:\Program Files\Java\jdk1.8.0_51\bin\java.exe" -Dmaven.ext.class.path="C:\Program Files\NetBeans 8.2\java\maven-nblib\netbeans-eventspy.jar" -Dfile.encoding=UTF-8 org.codehaus.mojo:exec-maven-plugin:1.2.1:exec""
So I tried to reproduce what Netbeans do this way:
- created environment variable "JAVA_HOME" with value "C:\Program Files\Java\jdk1.8.0_51"
- created file "run.bat" and put it in "D:\Users\username\Desktop\traccar"
- put this content in it:
"C:\Program Files\NetBeans 8.2\java\maven\bin\mvn.bat" -Dexec.args="-classpath %classpath org.traccar.Main debug.xml" -Dexec.executable="C:\Program Files\Java\jdk1.8.0_51\bin\java.exe" -Dmaven.ext.class.path="C:\Program Files\NetBeans 8.2\java\maven-nblib\netbeans-eventspy.jar" -Dfile.encoding=UTF-8 org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
Basically I removed the " and \ because they were causing errors. Unfortunately I get this:
[INFO] Building traccar 3.9-SNAPSHOT
...
[INFO] BUILD FAILURE
...
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project traccar: The parameters 'executable' for goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec are missing or invalid -> [Help 1]
All you need to do is use following maven command:
mvn package
mvn package
made the build. But now I need to run the server.
It's a regular Java application. You just need to provide a path to the config file as a command line argument.
Sorry for asking this very basic stuff, but the Build from source section is quite silent about how to run after you build.
Anyway, I was able to run with java -jar target/tracker-server.jar. Running "tracker-server-jar-with-dependencies.jar" seems to have the same effect.
Thanks for the reply and the great work.
Just make sure you pass config file as a command line argument.
sorry for this basic question but how do i pass the config file as a command line argument?
Thanks
Like this:
java -jar target/tracker-server.jar /path/to/config/traccar.xml
When I run it on Netbeans everything works and the console shows these commands:
cd D:\Users\username\Desktop\traccar; "JAVA_HOME=C:\Program Files\Java\jdk1.8.0_51" cmd /c """C:\Program Files\NetBeans 8.2\java\maven\bin\mvn.bat" -Dexec.args="-classpath %classpath org.traccar.Main debug.xml" -Dexec.executable="C:\Program Files\Java\jdk1.8.0_51\bin\java.exe" -Dmaven.ext.class.path="C:\Program Files\NetBeans 8.2\java\maven-nblib\netbeans-eventspy.jar" -Dfile.encoding=UTF-8 org.codehaus.mojo:exec-maven-plugin:1.2.1:exec""
So I tried to reproduce what Netbeans do this way:
"C:\Program Files\NetBeans 8.2\java\maven\bin\mvn.bat" -Dexec.args="-classpath %classpath org.traccar.Main debug.xml" -Dexec.executable="C:\Program Files\Java\jdk1.8.0_51\bin\java.exe" -Dmaven.ext.class.path="C:\Program Files\NetBeans 8.2\java\maven-nblib\netbeans-eventspy.jar" -Dfile.encoding=UTF-8 org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
Basically I removed the " and \ because they were causing errors. Unfortunately I get this: