I have a scenario where I need to run maven from a batch file to use JDK 8,I can't change the pom.xml nor can I change the environment variable.But I can change settings.xml.I get the following error as below:
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
I have setup profile as follows:
<profile>
<id>java8</id>
<activation>
<jdk>1.8</jdk>
</activation>
<build>
<plugins>
<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>
</plugins>
</build>
</profile>
I have activated the profile using below line
<activeProfiles>
<activeProfile>java8</activeProfile>
</activeProfiles>
But still I get the error No compiler is provided? How do I set the path variable to my Java Home.