I am a relative newcomer to the world of Java enterprise development. My organization\'s Java guru is out on indefinite family leave, and I have been assigned the task of m
If you are using maven include the following tag in pom.xml (update versions as needed) inside plugins tag.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
For me (on windows 10), I was getting the error "No compiler is provided in this environment" at the Windows command prompt when I ran mvn install
. The fix was changing the JAVA_HOME environment variable to point to my jdk (C:\Program Files\Java\jdk1.8.0_101); previously it had pointed to the jre.
And to get Eclipse to use the new jdk, I edited eclipse.ini
in my eclipse distribution and changed the line for -vm
to C:\Program Files\Java\jdk1.8.0_101\bin
.
This worked for me. 1. Click on Window-> Preferences -> Installed JRE. 2. Check if you reference is for JDK as shown in the image below.
If not, Click on Add-> Standard VM -> Give the JDK path by selecting the directory and click on finish as shown in the image
Last step, click on Installed JREs -> Execution Environments -> select your JDE as shown in the image below
Maven -> Clean
if someone is running Eclipse in Ubuntu and have this problem I have found the answer by following these steps:
Installed JRE In my case I solved the problem by removing duplicates of names, I kept only one with the name: jdk.1.8.0_101
Screen_shot Add 'tools.jar' to installed JRE.
Eclipse
-> window
-> preference
.installed JREs
-> Edit
tools.jar
from java/JDKx.x/lib
folder.