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 have a 32-bit Java installed just for Chrome and 64-bit Java JDK for everything else.

When I type java -version in the cmd, the 32-bit Java answers:

C:\>java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

This is the 32-bit JRE installed for Chrome (the installer name was chromeinstall.exe).

However, I'd like the default Java to be this one:

C:\>"Program Files\Java\jre6\bin\java.exe" -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

And for the fun part, only the 64-bit one is in PATH!

C:\>echo %PATH% 
C:\Windows\system32;C:\Program Files\Java\jre6\bin

(snipped irrelevant entries)

So long story short: 64-bit JRE is in PATH, but 32-bit JRE is ran by default. What is happening here? How to fix it?

Tried reinstalling the 64-bit JDK as a whole, didn't help.

share|improve this question
4  
Are you running 32-bit or 64-bit cmd.exe? –  ta.speot.is Jun 20 '11 at 12:07
    
It's the same in system32/cmd.exe and syswow64/cmd.exe if that's what you're referring to. –  Kos Jun 20 '11 at 13:27
add comment

1 Answer

up vote 3 down vote accepted

Edit your PATH

There is a java.exe in c:\windows\system32

You want C:\Program Files\Java\jre6\bin BEFORE C:\Windows\system32

Because it's C:\Program Files\Java\jre6\bin that you want to run when you type java

That's what I gather from your post anyway.

share|improve this answer
    
So the Chrome installer put the java binaries in system32? Now this is suprising for me... I didn't expect the matter to be so simple, thanks for the help! –  Kos Jun 21 '11 at 10:55
    
@Kos I have c:\windows\system32\java.exe too. java version I have there is 1.6.0_21. it's either really standard like there on a fresh install, or it's fairly standard, in the sense that, when you go to a website and it says you'll need to install java, and you click it, then you get it. whatever it is, most people have it, it's not from the chrome installer.. But you could monitor chromeinstaller.exe with process monitor and see what files it puts there. you could do process contains chromeinstaller path contains java. and maybe a button so it just shows files not registry. –  barlop Jun 21 '11 at 19:37
    
@Kos maybe you'l find chromeinstaller just puts it on there itself overwriting the one there in c:\windows\system32 and does some of chrome's own settings to get it to work. the java.exe there isn't tied to chrome or any one browser. According to this link googlechrometips.blogspot.com/2008/09/… there has been some issue with chrome and java so maybe the chrome bundled it in a way that resolved it hence the java for google chrome "concept"/"selling point /advertising spin/PR work" and "innovation" to cover the problem, I don't know . –  barlop Jun 21 '11 at 19:43
    
and, I think I installed chrome with chromesetup.exe which I think is the standard one, mine was i think 12/12/2010 568,696 ChromeSetup.exe. The newest one is 13/6/2011 568,696 Chromesetup.exe I didn't use chromeinstall. Also, people had that java.exe in system32 before chrome came along.. but if chromeinstall updates it I haven't checked. Where did you download that file from? I don't find that much about it, There's chromeinstaller.exe which may not be done anymore, and there's ChromeStandaloneSetup.exe which is about 22MB as of writing –  barlop Jun 21 '11 at 20:09
    
What I did was: uninstall all JREs and JDKs (no java.exe in path then), install the 64-bit JDK/JRE freshly, restart Chrome, try to use Java in Chrome (it was unable to use the 64-bit JRE ofc); then I went to the Java sites and chromeinstall.exe was the Java installer which I was pointed to. (let me stress that it's a 32-bit JRE installer, not Chrome installer.. probably a customized one) –  Kos Jun 23 '11 at 13:28
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.