I have windows 7 OS, java 1.7 and 1.8. Sonar works with 1.8, but I do not want to change my JAVA_HOME environment variable every time I compile the project with sonar. In a wrapper.conf I set wrapper.java.command=C:/Program Files/Java/jdk1.8.0_131/jre/bin/java but it still doesn't work. Also I changed the settings.xml in a .m2 folder putting
<profiles>
<profile>
<id>jdk8</id>
<properties>
<JAVA_HOME>C:\Program Files\Java\jdk1.8.0_131</JAVA_HOME>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
......
but without success.
I couldn't resolve this problem, and for that I've created a .bat file witch executes the commands I need.