[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. 
 
  • 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
    
        
             org.springframework.boot
             spring-boot-maven-plugin
        
        
             maven-compiler-plugin
             3.1
            
                 true
                 D:\jdk1. 7 .0_25\bin\javac.exe
            
        
    
Good Luck !!

你可能感兴趣的:(Maven)