Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.2.0
-
None
-
Java 7 x64 installed
Java 7 x86 not installed
Node x86 installed and used to run cordova/cordova-blackberry
Description
Both Java 7 x86 and Java 7 x64 install "java.exe" into "%systemroot%\system32" however, "%systemroot%\system32" is magical on windows.
When Java 7 x86 installs "java.exe" into that directory, it's actually installing into %systemroot%\syswow64 and when another 32bit application (node) looks for java in its path, it sees %systemroot%\system32 which is in fact %systemroot%\syswow64 and thus finds java.exe
When Java 7 x64 installs "java.exe" into that directory, it's there, but when a 32bit node.exe looks at "%systemroot%\system32", it's actually checking %systemroot%\syswow64 and won't find Java.
This is all sorts of fun for end users "It says it can't find java?" "java is right there!".
Since java will generally be installed in one of two well known locations (under program files 32bit or program files 64bit), we can look for it there (if necessary) and add that to the path.
The limited portion of the packaging tools that we use don't care whether you're using Java 7, Java 6, 32bit or 64bit... So we can just try to select a Java from a well known location.