I'm having an odd problem, when attempting to build my application using Maven, on the command line. (Other questions I've seen on SO are referring to building within Eclipse, or some other IDE)
When I attempt to build, maven complains that it cannot find Javac in tools.jar. Looking at the given location, it is obvious that Maven is looking in the JRE directory, however, I seem unable to get Maven to point to the correct Java_home for my JDK - any ideas on how this should be done?
Environment Overview
JAVA_HOME=C:\jdk1.6.0_27
Path=C:\jdk1.6.0_27\bin;...... (showing the jdk is the first thing on the path)
D:\> javac -version
javac 1.6.0_27 <-- This is correct
D:\>java -version
java version "1.6.0_31" <-- wtf?
D:\>mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-07 03:16:01+0800)
Java version: 1.6.0_31 <--- This is the problem - Where
Java home: C:\Program Files (x86)\Java\jre6 <--- does Maven get this from?
Any light you could shed on this would be most welcome.