错误如下
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project teavm-metaprogramming-api: Compilation failure [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
这是因为运行的是JRE,而不是JDK
解决办法
vi .bashrc export JAVA_HOME=${HOME}/tsjdk8 export PATH=${JAVA_HOME}/bin:${PATH}
查看
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: /home/uos/apache-maven-3.6.3 Java version: 1.8.0-taishan, vendor: AdoptOpenJdk, runtime: /home/tsit/tsjdk8-uos-64/jre Default locale: zh_CN, platform encoding: UTF-8 OS name: "linux", version: "4.19.0-6-amd64", arch: "amd64", family: "unix"
现在是在JDK的JRE上,就对了。