Maven build failed: “Unable to locate the Javac Compiler in: jre or jdk issue”

后端 未结 30 1988
长情又很酷
长情又很酷 2020-11-30 20:33

I have my JAVA_HOME set to:

C:\\Program Files (x86)\\Java\\jdk1.6.0_18

After I run maven ins

相关标签:
30条回答
  • 2020-11-30 20:56

    The solution is simple. Sometimes the Eclipse WindowsPreferencesJavaInstalled JREs pointing to C:\Program files\Java\jre.

    When I changed it to C:\Program files\Java\JDK 6.0\jre it is worked 100%.

    0 讨论(0)
  • 2020-11-30 20:57

    Use menu WindowPreferencesJavaInstalled JREsExecution Environments -> click the checkbox on the right side.

    0 讨论(0)
  • 2020-11-30 20:59

    File eclipse.ini needs the vm argument to point to your JDK location.

    Edit the eclipse.ini file to point to your JDK home, something as follows -

    -vm
    C:\Program Files\Java\jdk1.6.0_06
    

    This ensures that Eclipse would be running off the JDK and not any default JRE on your machine.

    0 讨论(0)
  • 2020-11-30 20:59

    You can also make sure that Eclipse has all of the updated changes. To do this, right-click your project and then press the "Refresh" menu item.

    0 讨论(0)
  • 2020-11-30 21:00

    Make sure the "-vm" in your eclipse.ini is on two sperate lines, ie:

    -vm
    C:\Program Files\Java\jdk1.6.0_06
    
    0 讨论(0)
  • 2020-11-30 21:01

    I had the same issue on Amazon Linux. It turns out I had to install the developer version of the JDK:

    sudo yum -y install java-1.7.0-openjdk-devel
    
    0 讨论(0)
提交回复
热议问题