Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to use 32 bits JRE on Windows 7 64 bits computer?

Reply
Thread Tools

How to use 32 bits JRE on Windows 7 64 bits computer?

 
 
zyng
Guest
Posts: n/a
 
      06-07-2012
Both 32 bits and 64 bits JRE are installed on Windows 7 64 bits computer. Normally, 64 bits JRE is used.

Right now, for some reason, we hope that 32 bits JRE is used when running a commercial Java program. Is this only the matter of setting the environment variable JAVA_HOME? We have tried that and it didn't show the effect we expected.

Thank you.
 
Reply With Quote
 
 
 
 
Robert Klemme
Guest
Posts: n/a
 
      06-07-2012
On 07.06.2012 20:46, zyng wrote:
> Both 32 bits and 64 bits JRE are installed on Windows 7 64 bits
> computer. Normally, 64 bits JRE is used.
>
> Right now, for some reason, we hope that 32 bits JRE is used when


What do you mean by "we hope"? Do you /want/ the 32 bit JRE to be used?
Or are you /assuming/ it is used?

> running a commercial Java program. Is this only the matter of setting
> the environment variable JAVA_HOME? We have tried that and it didn't
> show the effect we expected.


That depends entirely how the "commercial Java program" uses the JVM.
Could be a script, an executable etc. and we have no way of knowing how
it determines the JVM to use. Please provide more detail, especially
what you expected and maybe also what "commercial Java program" we are
talking about.

Kind regards

robert

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
 
Reply With Quote
 
 
 
 
zyng
Guest
Posts: n/a
 
      06-08-2012
Thank you for your reply. The issue has been solved.

Just another question, on Microsoft Windows computer, I have installed JDK and have set the environment variable JAVA_HOME:

(in Cygwin)
$ echo $JAVA_HOME
C:\Program Files\Java\jdk1.6.0_32

However, it seems "java" command is not from the JDK I installed, it is from c/Windows/system32/java. Why is that?

$ java -version
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)

$ which java
/cygdrive/c/Windows/system32/java

So, on my computer, I have two "java" commands. Is this one(c/Windows/system32/java) a gift from Microsoft?

I am puzzled.

Thank you very much.
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      06-08-2012
On Thu, 7 Jun 2012 11:46:11 -0700 (PDT), zyng <(E-Mail Removed)> wrote,
quoted or indirectly quoted someone who said :


>Right now, for some reason, we hope that 32 bits JRE is used when running a commercial Java program.
> Is this only the matter of setting the environment variable JAVA_HOME? We have tried that and it didn't show the effect we expected.


Astoundingly, the browsers find and load the appropriate JVM
automagically. Chrome needs a little help, but basically it is
automatic.

See http://mindprod.com/jgloss/googlechrome.html

You can verify this by running http://mindprod.com/applet/wassup.html
Try out IE 64 bit, and Firefox 32 bit or any of the other browsers at
http://mindprod.com/jgloss/browser.html

look for os.arch = amd64 vs x86 for 64 bit vs 32 bit or references to
Program Files vs Program Files (x86).

This applies to windows.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Controlling complexity is the essence of computer programming.
~ Brian W. Kernighan 1942-01-01
..
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      06-08-2012
On Thu, 7 Jun 2012 11:46:11 -0700 (PDT), zyng <(E-Mail Removed)> wrote,
quoted or indirectly quoted someone who said :

>Both 32 bits and 64 bits JRE are installed on Windows 7 64 bits computer. Normally, 64 bits JRE is used.
>
>Right now, for some reason, we hope that 32 bits JRE is used when running a commercial Java program.
> Is this only the matter of setting the environment variable JAVA_HOME? We have tried that and it didn't show the effect we expected.


Astoundingly, your browser selects the appropriate 32 or 64 bit JVM
automagically. You can verify this by running
http://mindprod.com/applet/wassup.html

Which is used for an app depends which is first on the path. You can
also put it on the pseudo path in the registry for Windows.
http://mindprod.com/jgloss/registry.html#AUXPATH

It is easiest to just specify fully if you flip often e.g.

E:\Program Files\Java\jdk1.7.0_04\bin\java.exe

or put it into a central global SET variable.
es.g.

set JAVA=E:\Program Files\Java\jdk1.7.0_04\bin\java.exe

%java% -ea someparm
--
Roedy Green Canadian Mind Products
http://mindprod.com
Controlling complexity is the essence of computer programming.
~ Brian W. Kernighan 1942-01-01
..
 
Reply With Quote
 
Robert Klemme
Guest
Posts: n/a
 
      06-08-2012
On Friday, June 8, 2012 2:40:39 AM UTC+2, zyng wrote:
> Thank you for your reply. The issue has been solved.
>
> Just another question, on Microsoft Windows computer, I have installed JDK and have set the environment variable JAVA_HOME:
>
> (in Cygwin)
> $ echo $JAVA_HOME
> C:\Program Files\Java\jdk1.6.0_32
>
> However, it seems "java" command is not from the JDK I installed, it is from c/Windows/system32/java. Why is that?


Because the shell does not use JAVA_HOME but PATH for lookup of executables..

> $ java -version
> java version "1.6.0_31"
> Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
> Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)
>
> $ which java
> /cygdrive/c/Windows/system32/java
>
> So, on my computer, I have two "java" commands. Is this one(c/Windows/system32/java) a gift from Microsoft?


Might be. Might also be that one Java installation put their executable there. Bottom line, you better make sure the proper executables from an installation directory are used. I typically have scripts which will honor JAVA_HOME and pick the proper executables so I can easily switch Java versions..

Kind regards

robert
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Is JRE from J2EE not usable to install a java browser plugin? Is separate JRE really necessary? Artur McCennon Java 0 07-22-2009 09:37 AM
Re-engineer application to run in JRE 1.4.2 against old JRE 1.1.7 Prasoon Java 1 04-13-2007 10:20 AM
JRE crash in production ... how to tell JRE is beta? nospawn Java 2 04-25-2006 11:27 AM
8-Bits vs 12 or 16 bits/pixel; When does more than 8 bits count ? Al Dykes Digital Photography 3 12-29-2003 07:08 PM



Advertisments