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

后端 未结 30 2213
盖世英雄少女心
盖世英雄少女心 2020-11-22 15:40

I\'m compiling a project in Eclipse using m2eclipse. I set the JDK path in Eclipse like this:

Windows-->preferences-->installed jres--> jdk1.7.xx  p         


        
30条回答
  •  花落未央
    2020-11-22 16:24

    I just wasted 3 hours with this problem until I managed to make it work. I had this error in the Eclipse Terminal when issuing a mvn compile command:

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

    So I read here that I have to make a new system variable called JAVA_HOME and make it point towards the jdk installation folder. However this generated another error:

    Source option 1.5 is no longer supported. Use 1.6 or later

    Couldn't find a fix for this one so...

    So the fix to make it all go away is install Java SE Development Kit 8! I was using 9 thinking that if it's the latest it must be better...

    Anyway...

    1. Uninstall all java versions from your computer
    2. Install JDK8 from here: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

    3. Then define the JAVA_HOME system environmental value - tutorial here: https://docs.oracle.com/cd/E19509-01/820-3208/inst_cli_jdk_javahome_t/

    4. Restart Eclipse and enjoy! (at least that's what I did)

    Hoping this spares some poor wanderer of some trouble.

提交回复
热议问题