开发者社区> 问答> 正文

初学Spring Boot,Maven install报错?报错

求助!项目使用spring boot APP正常运行,尝试着打包maven install爆出如下错误:

我在使用ssm(非Spring boot)能够正常install。也尝试过update project -> clean -> install的循环,后面给出创建该项目的过程和eclipse的配置

[INFO] Scanning for projects...

[INFO]

[INFO] -----------------< cn.gd.hel.study:spring-boot-study >------------------

[INFO] Building spring-boot-study 0.0.1-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO]

[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ spring-boot-study ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 1 resource

[INFO] Copying 2 resources

[INFO]

[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ spring-boot-study ---

[INFO] Changes detected - recompiling the module!

[INFO] Compiling 9 source files to F:\stsWorkSpace\studyWork\spring-boot-study\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: 1.540 s

[INFO] Finished at: 2018-09-21T21:11:17+08:00

[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.7.0:compile (default-compile) on project spring-boot-study: 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/MojoFailureExcept

展开
收起
爱吃鱼的程序员 2020-06-06 15:09:24 569 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB
                        <p>maven 的package插件没配置?</p>
    
                    
    
                            我只会用基本的maven操作,还不知道这个package插件呢,刚才网上找了一下好像也没有说这个的,是packge打包命令吗?这个我试过,也是提示编译插件的问题
                        
    
                        <pre><build>
    	<plugins>
    		<plugin>
    			<groupId>org.springframework.boot</groupId>
    			<artifactId>spring-boot-maven-plugin</artifactId>
    			<version>2.0.5.RELEASE</version>
    			<executions>
    				<execution>
    					<goals>
    						<goal>repackage</goal>
    					</goals>
    				</execution>
    			</executions>
    		</plugin>
    	</plugins>
    </build></pre>
                    
    
                        <p>你看一下 javac -version</p>
    
                    
    
                        <p>把这勾一下,要选jdk,不要选jre <img alt="" height="742" src="https://static.oschina.net/uploads/space/2018/0926/091503_AWVx_3233292.png" width="897"></p>
    
                    
    
                        <p>不好意思哈,很久没上。发现并不是配置有问题,我通过命令行mvn install是可以正常打包,而使用STS就会报错,我也不明白什么情况。。</p>
    
    2020-06-06 15:09:42
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
云栖社区特邀专家徐雷Java Spring Boot开发实战系列课程(第20讲):经典面试题与阿里等名企内部招聘求职面试技巧 立即下载
微服务架构模式与原理Spring Cloud开发实战 立即下载
阿里特邀专家徐雷Java Spring Boot开发实战系列课程(第18讲):制作Java Docker镜像与推送到DockerHub和阿里云Docker仓库 立即下载

相关实验场景

更多