yjh777 发表于 2016-03-28 12:13

mvn 编译失败,求解决?

本帖最后由 yjh777 于 2016-03-29 16:06 编辑

想下载pysonar2试用一下,可是发现编译出错:

git clone https://github.com/yinwang0/pysonar2$ mvn package
Scanning for projects...
                                                                        
------------------------------------------------------------------------
Building pysonar2 2.0-SNAPSHOT
------------------------------------------------------------------------

--- maven-resources-plugin:2.6:resources (default-resources) @ pysonar ---
Using 'UTF-8' encoding to copy filtered resources.
Copying 5 resources

--- maven-compiler-plugin:3.1:compile (default-compile) @ pysonar ---
Changes detected - recompiling the module!
Compiling 102 source files to /home/yjh/ws/tools.repo/pysonar2/target/classes
-------------------------------------------------------------
COMPILATION ERROR :
-------------------------------------------------------------
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
1 error
-------------------------------------------------------------
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 0.936 s
Finished at: 2016-03-24T15:15:14+08:00
Final Memory: 14M/95M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project pysonar: Compilation failure
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
->

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException环境:$ lsb_release -sir
Fedora 23
$ rpm -q maven
maven-3.3.3-3.fc23.noarch
$ rpm -qa|grep ^java
java-1.8.0-openjdk-1.8.0.65-3.b17.fc23.x86_64
javapackages-tools-4.6.0-7.fc23.noarch
java-1.8.0-openjdk-headless-1.8.0.65-3.b17.fc23.x86_64
$ rpm -qa|grep jre
jre-1.7.0_80-fcs.x86_64
jre1.8.0_66-1.8.0_66-fcs.x86_64

yjh777 发表于 2016-03-29 16:02

已解决:

原因是 javac 没有安装(竟然不在JDK JRE包里),而在 devel 包里:
    java-1.8.0-openjdk-devel

yjh777 发表于 2016-03-29 16:04

问题已解决,javac没有安装,见二楼

fenyun689 发表于 2016-04-15 15:48

问题解决了。积分送我吧。:lol
页: [1]
查看完整版本: mvn 编译失败,求解决?