This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Is sun's JVM 64 bit? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Is sun Watch "Is sun New topic
Author

Is sun's JVM 64 bit?

Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4646
    
    5

I've been using 32 bit OS and have been using Sun's JVM.

I recently setup a system with 64 bit linux (Ubuntu 9.04) and didn't think to check specifically for a 64 bit JVM

java -version
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Server VM (build 14.0-b16, mixed mode)


Does this indicate whether it is 32 or 64 bit?

Thanks
pat
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Which one did you download?
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4646
    
    5

David Newton wrote:Which one did you download?


well, it said X86/something 64

But the download file name is not supposed to be important. One recent one I've tried is
jdk-6u14-nb-6_5_1-linux-ml.sh

The java.sun.com site is unclear as to what it is. They have specifics on 64 bit SDK/JVM but only talk about Solaris and the commercial Linux distros (red hat, Suse, etc.)

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

When you download a JDK it asks you which one you want. Not sure why you believe the filename is insignificant.

I don't know if it shows up in the -version blurb or not--I thought it did, but I don't have a 64-bit version handy to check. (I take that back; it reports correctly as 64-bit on my OS X machine.)

This might also help: http://forums.java.net/jive/message.jspa?messageID=274406
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4646
    
    5

David Newton wrote:. (I take that back; it reports correctly as 64-bit on my OS X machine.)


how does it indicate correct 64-bit ness?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

It says "64 bit" somewhere in the VM description.

You didn't download the 64-bit version, based on your filename. AFAIK the NB bundle is the 32-bit version, which your -version info seems to indicate.

The appended link allows you to choose which bitness you want:

https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=jdk-6u16-oth-JPR@CDS-CDS_Developer
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

If you are running Ubuntu, and you install Sun Java from the Ubuntu repository instead of installing it manually (by downloading it directly from Sun):

sudo apt-get install sun-java6-jdk

Then you'll get the 64-bit version of Sun Java if your Ubuntu is also 64-bit.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4646
    
    5

Jesper Young wrote:If you are running Ubuntu, and you install Sun Java from the Ubuntu repository instead of installing it manually (by downloading it directly from Sun):
sudo apt-get install sun-java6-jdk
Then you'll get the 64-bit version of Sun Java if your Ubuntu is also 64-bit.


That's nice to know, as finding the right one on the java.sun.com site is a pain.
I don't see a parallel for the JEE JDK/libaries, perhaps they are size agnostic?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

I don't think there are Ubuntu packages for Java EE, but as far as I know Glassfish (Sun's Java EE reference implementation) is pure Java anyway, so there shouldn't be separate 32-bit and 64-bit versions.
Salman Ahmed
Greenhorn

Joined: Mar 18, 2008
Posts: 27
One more way to check if you're installed JVM is 64-bit is to see if the "java" executable accepts the "-d64" option to specify the 64-bit data model.
If your JVM is 64-bit capable, it will accept either the "-d32" or the "-d64" option to select either the 32-bit or 64-bit data model respectively.

(Sample output taken from a 64-bit Debian install)
ssahmed@debian:[~]$ uname -a
Linux debian 2.6.26-2-amd64 #1 SMP Mon Oct 19 02:34:17 UTC 2009 x86_64 GNU/Linux
ssahmed@debian:[~]$ java
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)

where options include:
-d32 use a 32-bit data model if available

-d64 use a 64-bit data model if available
-server to select the "server" VM
The default VM is server.
<rest of output snipped>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is sun's JVM 64 bit?
 
Similar Threads
Multi CPU configuration for a webapplication deployed on tomcat
How to check the jdk bit version (32bit or 64 bit)
32 bit JVM memory heap issue on 64 bit XP
jvm 32 or 64 bit
no `server' JVM