uniquewdl 2018-06-30 08:24 采纳率: 50%
浏览 1563
已采纳

springboot入门项目打包出错

执行clean package时候报错项目正常运行
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ demo-test ---
[INFO] Deleting E:\EclipseMars\e3-manager\demo-test\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ demo-test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ demo-test ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to E:\EclipseMars\e3-manager\demo-test\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.689 s
[INFO] Finished at: 2018-06-30T16:12:47+08:00
[INFO] Final Memory: 20M/112M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "pom.xml" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project demo-test: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

百度上说的jre我都试过了,我用的是jdk而且是1.8.
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project demo-test: Compilation failure说找不到3.1
但是我配置这个jar包换个版本却还是报错找不到3.1这个版本。

  • 写回答

7条回答 默认 最新

  • qq_18342337 2018-06-30 08:53
    关注

    No compiler is provided in this environment 没选择jdk,编译没通过

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
  • uniquewdl 2018-06-30 09:35
    关注

    不行啊,我多次配置jdk和jre都不行

    评论
  • uniquewdl 2018-06-30 09:44
    关注

    Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project demo-test: Compilation failure 主要是这个问题,大家帮忙解决以下。

    评论
  • 梦小星 2018-06-30 11:30
    关注

    你配置maven-compiler依赖的时候,里面有配JDK吗?




    org.apache.maven.plugins
    maven-compiler-plugin

    1.7
    1.7


    评论
  • firstsir0 2018-06-30 16:07
    关注

    IDE配置的java路径是一个jre不是一个jdk,去改下ide的配置就行了,在已安装java那把路径改成jdk的路径。sts默认是jre

    评论
  • 漏墨小子 2018-07-02 01:56
    关注

    你看看 你eclipse 的 maven 配置 图片说明

    评论
  • uniquewdl 2018-07-03 01:02
    关注

    非常感谢大家帮助,最终问题还是解决了,主要原因就是我安装的jdk不是放在c盘的指定目录,sts貌似只认c:\pro...file\java.....
    我把jdk重新安装在默认的目录下就可以解决了。

    评论
查看更多回答(6条)

报告相同问题?

悬赏问题

  • ¥15 stm32f103zet6 串口5无法收发数据
  • ¥15 宝塔面板的data内存要怎么清理呢
  • ¥15 关于C语言使用线程队列实现多线程并发
  • ¥15 这个运行,错误在哪里呀,大家看看吧,教导我
  • ¥15 advanceinstaller对话框设置
  • ¥100 正常上网,内部网页无法打开
  • ¥15 组件库引入并使用在若依框架未展示
  • ¥149 关于#使用python 的Flash Echarts+ajax+mysql动态数据实现饼图#的问题,请各位专家解答!
  • ¥15 RichTextBox中追加文本时报错
  • ¥15 关于c语言的学习问题