[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a

原文:http://www.kriblog.com/ide/sts/error-no-compiler-is-provided-in-this-environment.-perhaps-you-are-running-on-a-jre-rather-than-a-jdk.html

It's really a bad day for me, I have spend allot of time download zip version of latest Spring Tool Suite based on Eclipse 4.4.1 and now I am getting following error.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[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:  18.162 s
[INFO] Finished at:  2014 - 12 -30T02: 13 : 56 + 05 : 30
[INFO] Final Memory: 8M/19M
[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: Compilation failure
[ERROR] No compiler is provided in  this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help  1 ]
Does anyone know what is the issue?

Thanks in advance !!

Posted by Navdeep on 2014-12-16 09:36:03.0


You can choose any of following solution to fix [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

Solution - 1 No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK

  • Click on Windows -> Preferences -> Java -> Installed JREs -> Add -> Standard VM and Select JAVA_HOME. 
Click on Windows -> Preferences -> Java -> Installed JREs -> Add -> Standard VM and Select JAVA_HOME
 
  • Select New JRE from Installed JREs and Press OK
Select New JRE from Installed JREs and Press OK

Solution - 2 No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK

Most simple and working in all the scenario 

  • Step 1 - Open the installed directory of Spring Tool Suite (STS)
  • Step 2 - Right click on STS.ini
  • Step 3 - Enter -VM JAVA_HOME/bin/javaw.exe and restart Eclipse Spring Tool Suite (STS), Eclipse will automatically pickup this JDK.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-vm
G:/jdk1. 7 .0_25/bin/javaw.exe
-startup
plugins/org.eclipse.equinox.launcher_1. 3.0 .v20140415- 2008 .jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1. 1.200 .v20140603- 1326
-product
org.springsource.sts.ide
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-vmargs
-Dosgi.requiredJavaVersion= 1.6
-Xms40m
-Xmx768m
-XX:MaxPermSize=256m
-Dorg.eclipse.swt.browser.IEVersion= 10001

Solution - 3 No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK

Open the pom.xml and enter following highlighted line with correct JDK path !!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<build>
     <plugins>
         <plugin>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-maven-plugin</artifactId>
         </plugin>
         <plugin>
             <artifactId>maven-compiler-plugin</artifactId>
             <version> 3.1 </version>
             <configuration>
                 <fork> true </fork>
                 <executable>D:\jdk1. 7 .0_25\bin\javac.exe</executable>
             </configuration>
         </plugin>
     </plugins>
</build>
Good Luck !!
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值