出错场景还原:
输入:make px4_sitl_default jmavsim
输出:...
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by javax.media.j3d.JoglPipeline (rsrc:j3dcore.jar)
to method sun.awt.AppContext.getAppContext()
...
3个步骤快速解决问题:
sudo apt install openjdk-8-jdk
sudo update-alternatives --config java (选择Java 8 的指令,这一步是核心)
rm -rf Tools/jMAVSim/out
原因分析:
出错原因:系统使用的Java版本大于8;
而仿真要求Java版本为8
查看目前使用的Java版本:
输入:java -version
输出:openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-2ubuntu218.04)
OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-2ubuntu218.04, mixed mode, sharing)
我们看到目前使用的是Java11.0.7版本,需要按照上面的步骤做出调整!
相似出错场景:
有以下的任意一个错误提示都可以说明系统目前使用的Java版本不为8
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by javax.media.j3d.JoglPipeline (rsrc:j3dcore.jar) to method sun.awt.AppContext.getAppContext()
WARNING: Please consider reporting this to the maintainers of javax.media.j3d.JoglPipeline
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Inconsistency detected by ld.so: dl-lookup.c: 112: check_match: Assertion version->filename == NULL || ! _dl_name_match_p (version->filename, map)' failed!
---------------------------------------------------END----------------------------------------------------