Try making JAVA_HOME point to the JDK rather than JRE. In your case, it
looks
like it should be:
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_38
The PATH should include a reference to the bin directory, as in:
set PATH=C:\Program Files\Java\jdk1.6.0_38\bin:%PATH%
Tom