Issue with building PX4 software

I followed the instruction here Building the Code · PX4 Developer Guide

However, when I got to this step

make posix jmavsim

The error occurred

Error: Unable to access jarfile jmavsim_run.jar

I don’t know how to resolve it.
I would be very appreciated for your help.

Thanks.

Does this work? make posix_sitl_default jmavsim_iris
Please post the full output if it doesn’t.

i am facing the same issue here. Sometimes it keeps staying at ‘waiting for simulator’ stage:

[2/2] cd /home/caomuqing/iot_px4/build_posix_sitl_default/tmp && /home/caomuqing/iot_px4/Tools/sitl_r.../init/ekf2 none jmavsim iris /home/caomuqing/iot_px4 /home/caomuqing/iot_px4/build_posix_sitl_default
args: /home/caomuqing/iot_px4/build_posix_sitl_default/src/firmware/posix/px4 posix-configs/SITL/init/ekf2 none jmavsim iris /home/caomuqing/iot_px4 /home/caomuqing/iot_px4/build_posix_sitl_default
SITL ARGS
sitl_bin: /home/caomuqing/iot_px4/build_posix_sitl_default/src/firmware/posix/px4
rcS_dir: posix-configs/SITL/init/ekf2
debugger: none
program: jmavsim
model: iris
src_path: /home/caomuqing/iot_px4
build_path: /home/caomuqing/iot_px4/build_posix_sitl_default
SITL COMMAND: /home/caomuqing/iot_px4/build_posix_sitl_default/src/firmware/posix/px4 /home/caomuqing/iot_px4 /home/caomuqing/iot_px4/posix-configs/SITL/init/ekf2/iris
data path: /home/caomuqing/iot_px4
commands file: /home/caomuqing/iot_px4/posix-configs/SITL/init/ekf2/iris

______  __   __    ___ 
| ___ \ \ \ / /   /   |
| |_/ /  \ V /   / /| |
|  __/   /   \  / /_| |
| |     / /^\ \ \___  |
\_|     \/   \/     |_/

px4 starting.

0 WARNING: setRealtimeSched failed (not run as root?)
/home/caomuqing/iot_px4/Tools/jmavsim_run.sh: line 44: ant: command not found
/home/caomuqing/iot_px4/Tools/jmavsim_run.sh: line 45: cd: out/production: No such file or directory
Error: Unable to access jarfile jmavsim_run.jar
INFO  [dataman] Unknown restart, data manager file 'rootfs/fs/microsd/dataman' size is 11405140 bytes
INFO  [platforms__posix__drivers__ledsim] LED::init
INFO  [platforms__posix__drivers__ledsim] LED::init
INFO  [simulator] Waiting for initial data on UDP port 14560. Please start the flight simulator to proceed..

But sometimes it show the Error: Unable to access jarful jmavsim_run.jar, after the ‘waiting for simulator’ message:

______  __   __    ___ 
| ___ \ \ \ / /   /   |
| |_/ /  \ V /   / /| |
|  __/   /   \  / /_| |
| |     / /^\ \ \___  |
\_|     \/   \/     |_/

px4 starting.

18446744073709551615 WARNING: setRealtimeSched failed (not run as root?)
/home/caomuqing/iot_px4/Tools/jmavsim_run.sh: line 44: ant: command not found
/home/caomuqing/iot_px4/Tools/jmavsim_run.sh: line 45: cd: out/production: No such file or directory
INFO  [dataman] Unknown restart, data manager file 'rootfs/fs/microsd/dataman' size is 11405140 bytes
INFO  [platforms__posix__drivers__ledsim] LED::init
INFO  [platforms__posix__drivers__ledsim] LED::init
INFO  [simulator] Waiting for initial data on UDP port 14560. Please start the flight simulator to proceed..
Error: Unable to access jarfile jmavsim_run.jar

Any idea?

/home/caomuqing/iot_px4/Tools/jmavsim_run.sh: line 44: ant: command not found

Maybe you should install ant? For example, if you use ubuntu, run this command in terminal:

sudo apt-get install ant

Hi,

No, it doesn’t work.

Please advise.

Thanks, Yoni.

yes, that worked for me - problem fixed! thanks!