I am running my maven build through my command prompt where I set the M2_HOME variable in my system variables. However, when I run a mvn compile
in my command prompt I get the following error:
no compiler is provided in this environment. perhaps you are running on a jre rather than a jdk
but when I run the goal mvn compile
in my eclipse GUI it works fine.
When I added this to my pom.xml
it was able to compile in my command prompt but I need it to work without have to place that in my pom.
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<executable>C:\programfi\Java\jdk1.8.0_73\bin\javac.exe</executable>
</configuration>
</plugin>
This is NOT a duplicate question since other questions similar to this is asking for the eclipse GUI, where I am asking for command prompt.