aspose file tools*
The moose likes Java in General and the fly likes CLI does not detect 32 bit JRE 7 on Windows 7 64 bit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "CLI does not detect 32 bit JRE 7 on Windows 7 64 bit " Watch "CLI does not detect 32 bit JRE 7 on Windows 7 64 bit " New topic
Author

CLI does not detect 32 bit JRE 7 on Windows 7 64 bit

Steve Atkins
Greenhorn

Joined: Jun 20, 2009
Posts: 7
Hi,

I've installed 32 bit JRE 7 on 64 bit Windows 7 OS. The following registry path is created with entries for JavaHome and RuntimeLib under it:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment\1.7.0_13

But when I go to CLI and enter the command java it displays the 'java' is not recognized as an internal or external command, operable program or batch file

This problem does not occur when I install 64 bit JRE and without even manually setting the JAVA_HOME and PATH environment variables to their appropriate values.

Anybody any ideas on why error occurs for 32 bit JRE but not for 64 bit JRE?

One possible reason is that CLI is 64 bit process so it detects 64 bit JRE but not 32 bit JRE - am I right or wrong?

Please help!!!
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19696
    
  20

I believe you're right. Well, partly anyway.

If I open a command prompt using the start menu and execute "java -version", it shows the 64bit version. If I use my 32bit version of Total Commander to open a command prompt and execute "java -version", it shows the 32bit version. So the command prompt isn't necessarily 32bit or 64bit - it depends on how it is started. And a 32bit command prompt tries to run a 32bit JVM, and a 64bit command prompt tries to run a 64bit JVM.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Steve Atkins
Greenhorn

Joined: Jun 20, 2009
Posts: 7
Rob Spoor wrote:I believe you're right. Well, partly anyway.

If I open a command prompt using the start menu and execute "java -version", it shows the 64bit version. If I use my 32bit version of Total Commander to open a command prompt and execute "java -version", it shows the 32bit version. So the command prompt isn't necessarily 32bit or 64bit - it depends on how it is started. And a 32bit command prompt tries to run a 32bit JVM, and a 64bit command prompt tries to run a 64bit JVM.


Thank you Rob!

Is it possible to programmatically run 64 bit CLI process in 32 bit mode - thereby resulting in CLI detecting the 32 bit JRE?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19696
    
  20

I don't think so. It's one of the reasons I install both on my machines.
Steve Atkins
Greenhorn

Joined: Jun 20, 2009
Posts: 7
Rob Spoor wrote:I don't think so. It's one of the reasons I install both on my machines.


Thanks Rob! Appreciate that!
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19696
    
  20

You're welcome.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: CLI does not detect 32 bit JRE 7 on Windows 7 64 bit