title: Different version of Java in cygwin
body: <p>Today I installed cygwin and I was checking my JAVA HOME and other settings and I found out very strange thing.. </p>
  
  <p>When I do, <code>echo $JAVA_HOME</code>, I always get <code>C:\Java\jdk1.6.0_26</code> which is fine and that's what I have already set to <code>jdk1.6.0_26</code> in my environment variables as well but when I do java -version, I always get different version of java, I always see 1.7.. </p>
  
  <pre><code>uname@D-PHC-22334455 /cygdrive/c
  $ echo $JAVA_HOME
  C:\Java\jdk1.6.0_26
  
  uname@D-PHC-22334455 /cygdrive/c
  $ which java
  /cygdrive/c/WINDOWS/system32/java
  
  uname@D-PHC-22334455 /cygdrive/c
  $ java -version
  java version "1.7.0_25"
  Java(TM) SE Runtime Environment (build 1.7.0_25-b17)
  Java HotSpot(TM) Client VM (build 23.25-b01, mixed mode)
  </code></pre>
  
  <p>I have already checked my PATH variables and JAVA_HOME as well.. Both are pointing to jdk1.6
  Can anybody explain what wrong has happened?</p>
  
  <p>Below is my PATH variable-</p>
  
  <pre><code>uname@D-PHC-22334455 /cygdrive/c
  $ echo $PATH
  /usr/local/bin:/usr/bin:/cygdrive/c/Java/jdk1.6.0_26:/cygdrive/c/Program Files (x86)/DataStax Community/python:/cygdrive/c/Users/uname/openssl/bin:/cygdrive/c/Python27:/cygdrive/c/Python27/Scripts:/cygdrive/d/app/uname/product/11.1.0/db_1/bin:/cygdrive/c/apache-maven-3.0.4-bin/apache-maven-3.0.4/bin:/cygdrive/c/Program Files (x86)/IBM/RationalSDLC/Clearquest/cqcli/bin:/cygdrive/c/Perl64/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/Perl64/bin:/cygdrive/c/Program Files (x86)/Perforce:/cygdrive/c/Program Files (x86)/IBM/RationalSDLC/ClearCase/bin:/cygdrive/c/Program Files (x86)/IBM/RationalSDLC/common:/cygdrive/d/ede-5.1.1/apache-ant-1.7.1.2008.06.27/bin:/cygdrive/c/Program Files (x86)/Git/cmd:/usr/bin:/cygdrive/c/Program Files/Common Files/Hitachi ID:/cygdrive/c/Eclipse-C++/MinGW:/etc/alternatives:%APPDATA%/Python/Scripts
  </code></pre>