SpinalHDL 在IDEA 中能正常仿真,但在terminal 中会crush
fatal error: jni.h: No such file or directory
[info] [Progress] Simulation workspace in /homeXXXXX/./simWorkspace/intHubSim
[info] [Progress] Verilator compilation started
[info] ../verilator/VintHubSim__spinalWrapper.cpp:5:10: fatal error: jni.h: No such file or directory
[info] 5 | #include <jni.h>
[info] | ^~~~~~~
[info] compilation terminated.
[info] make[1]: *** [VintHubSim.mk:76: VintHubSim__spinalWrapper.o] Error 1
[info] make[1]: *** Waiting for unfinished jobs....
[error] Exception in thread "main" java.lang.AssertionError: assertion failed: Verilator C++ model compilation failed
[error] at scala.Predef$.assert(Predef.scala:223)
[error] at spinal.sim.VerilatorBackend.$anonfun$compileVerilator$20(VerilatorBackend.scala:651)
[error] at spinal.sim.VerilatorBackend.cacheSynchronized(VerilatorBackend.scala:75)
原因: java 不是指定的JAVA
$ which java
/usr/bin/java
$ java -version
openjdk version "11.0.17" 2022-10-18
OpenJDK Runtime Environment (build 11.0.17+8-post-Ubuntu-1ubuntu220.04)
OpenJDK 64-Bit Server VM (build 11.0.17+8-post-Ubuntu-1ubuntu220.04, mixed mode, sharing)
$ $JAVA_HOME/bin/java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
为啥设置了JAVA_HOME, java 的版本还是没变化, 跟PATH的设置方式有关
export JAVA_HOME=/pub/xxxxxtool/java/jdk1.8.0_144/
export PATH=$PATH:$JAVA_HOME/bin
改成
export JAVA_HOME=/pub/xxxxxtool/java/jdk1.8.0_144/
export PATH=$JAVA_HOME/bin:$PATH