Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm downloading the 32 bit java version, from Java.com, http://java.com/en/download/manual.jsp. It saves as

jre-6u27-windows-i586-s

Yet, when I install it, instead the 64 bit version is installed (??). There is no javaw.exe in /System32 folder, but there is in the SysWOW64 folder.

I never had this problem before. What to do? I need this for 32 bit java programs.

share|improve this question
    
What do you get when you go to CMD and type java -version? –  AndrejaKo Oct 17 '11 at 5:45
    
@AndrejaKo; I need to go to the \SysWOW64 folder, then it shows (Java SE Runtime Environment build 1.6.0_27-b07), and (Java Hotspot Client VM build 20.2-b06, mixed mode, sharing). And according to this test: java.com/en/download/testjava.jsp, it says Architecture x86. –  bretddog Oct 17 '11 at 10:09
1  
"I need this for 32-bit Java programs" - There is no such thing (unless you use JNI). "A compiled Java program can run on a 32 bit or 64 bit Java virtual machine without modification. The lengths and precision of all the built in types are specified by the standard and are not dependent on the underlying architecture. - oracle.com/technetwork/java/… and stackoverflow.com/questions/783662/… –  RedGrittyBrick Oct 17 '11 at 10:13
    
@Red: Sure, that's logical. Though I was advised to use 32bit version for a specific program, I do not know what impact it has. Though it still exists the problem that System32/javaw.exe does not exist, and hence programs referencing it find nothing. –  bretddog Oct 17 '11 at 10:18
add comment

2 Answers

up vote 3 down vote accepted

That's exactly where it belongs. From Wikipedia's WoW64 page:

The operating system uses the %SystemRoot%\system32 directory for its 64-bit library and executable files. This is done for backward compatibility reasons, as many legacy applications are hardcoded to use that path. When executing 32-bit applications, WoW64 transparently redirects 32-bit DLLs to %SystemRoot%\SysWOW64, which contains 32-bit libraries and executables. 32-bit applications are generally not aware that they are running on a 64-bit operating system. 32-bit applications can access %SystemRoot%\System32 through the pseudo directory %SystemRoot%\sysnative.

share|improve this answer
    
Thanks, that made it a bit clearer! But a program referencing /System32/javaw.exe in it's target link will simply fail to start. Is this correct behavior? I don't see any redirection happening. –  bretddog Oct 17 '11 at 4:55
    
I preface this by saying I don't know Java well. If you install the 64-bit version of Java, then it should run correctly because it will be in C:\Windows\System32. Unless the java code calls 32-bit DLLs, it should compile and run just fine in a 64-bit environment. –  Hand-E-Food Oct 17 '11 at 5:04
    
Well this is the odd thing I noted in my question: There is no java files in /System32. Yet I think I have installed 32bit, at least according to the test here, it says x86 java.com/en/download/testjava.jsp But the java files are in SysWOW64 folder. –  bretddog Oct 17 '11 at 10:06
    
Yes. On a 64-bit operating system, 32-bit Java installs to \SysWOW64 and 64-bit Java installs to \System32. On a 32-bit operating system, 32-bit Java installs to \System32 and 64-bit Java doesn't install. Use the version that suits the operating system and it should work for you. –  Hand-E-Food Oct 17 '11 at 22:17
add comment

Why do 64bit dlls go to System32 and 32bit dlls to SysWoW64 on 64bit Windows?

As I understand it, On a 64-bit Windows system, System32 is reserved for 64-bit binaries. So it would be wrong to put a 32-bit javaw.exe binary there.

Programs that need to invoke Java programs shouldn't really have the location of javaw.exe hardcoded into them, they should rely on the PATH.

How to execute a Java program from C#?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.