我正在从终端在Solaris服务器上使用mvn compile
编译一个简单的maven应用程序,并且出现以下错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project maven-demo: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
JAVA_HOME指向/home/userName/Java/jdk1.8.0_201
我找到的所有解决方案都涉及日食偏好。我需要从终端编译它,有什么帮助吗?
更新:
这是mvn -version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)
Maven home: /home/userName/Maven/apache-maven-3.6.0
Java version: 1.8.0_112, vendor: Oracle Corporation, runtime: /usr/jdk/instances/jdk1.8.0/jre
Default locale: en, platform encoding: ISO646-US
OS name: "sunos", version: "5.11", arch: "sparcv9", family: "unix"
答案 0 :(得分:-1)
如果您使用的是Linux / Red-hat版本,则仅
-> yum install java-1.8.0-openjdk-headless.x86_64
-> yum install java-1.8.0-openjdk-devel.x86_64
-> update-alternatives --config java #pick java 1.8
并按1
-> update-alternatives --config javac #pick java 1.8
并按2
谢谢