Link to home
Start Free TrialLog in
Avatar of asugri
asugri

asked on

How to determine 32-bit or 64-bit version of java on Windows?

Hi there,

How do I determine 32-bit or 64-bit version of java on Windows?
Just run   java -version  and see if 64-bit appears?

Thanks.

ASKER CERTIFIED SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
probably
java -d64 -version is the way
At least on my 32 bit it complains
Here's what happens if I try for_yan's suggestion on 32bit Linux

$ java -d64
Running a 64-bit JVM is not supported on this platform.

I can test on 64-bit windows if you request it.  (I have to reboot so I'll want a request before I bother).
No it looks like -d64 works only on Solaris not on Windows

It lloks like you have to do it from java program using System.getProperty("sun.arch.data.model")

I also thought that default installation directory of java on Windows is named differently, but of vourse one may
install it not in the default directory
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, someone writes there, that -d64 does not work on windows
and in the description of java switches for Solaris they mention that -d64 should work.
Perhaps also works on Linux
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
how about
java -Xmx2000M -version
in case of 64bit ?
SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

in java program it should be doable with this
 System.getProperty("sun.arch.data.model")

Yes - you mentioned that already...
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of asugri
asugri

ASKER


java -d64 does not work on Windows.
java -Xmx2000M -version  to test memory limit is interesting.

We are developing a package using java.  This package uses a dll file.  
32-bit java needs 32-bit dll and 64-bit java needs 64-bit dll.   We are
planning to test out version of java from InstallShield and determine
which dll to provide.   But I think System.getProperty("sun.arch.data.model")
is good since I just load different dll based on value returned by
System.getProperty("sun.arch.data.model").

Thanks a lot for the help.