aspose file tools
The moose likes Java in General and the fly likes Do java classes need to be recompiled for 64 bit  O/S Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Do java classes need to be recompiled for 64 bit  O/S" Watch "Do java classes need to be recompiled for 64 bit  O/S" New topic
Author

Do java classes need to be recompiled for 64 bit O/S

sunil choudhary
Ranch Hand

Joined: Nov 10, 2000
Posts: 138
We usaually see that we have a seperate Software for 32 bit and 64 bit O/S
Also people say that 64 bit machines can run most of 32 bit software albeit performance increase is not guaranteed.


My search into hte ranch gave me one nugget that is
----------
"By default jvm runs in 32 bit mode. I think you have to pass an argument
( -d64 ) into the JVM to make it run in 64 bit mode. " (Thanks Rich)
-----

My question is if we need to recompile our java classes and jar files (and regenerating this byte code) to get them to work efficiently. Or it is not required as it is the jvm which is handling the execution.

thanks for inputs.
Sunil


----------------------------------<br />"Learning is weightless, a treasure you can always carry easily."<br />-Chinese Proverb
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3652

Nope, you don't need to recompile. 64-bits doesn't mean the code runs more efficiently, it has to do with the maximum amount of memory that can be allocated by a program, and this is completely controlled by the JVM.

The compiled code isn't compiled for a specific machine or processor, the JVM will take the java compiled code and interpret it properly into real machine code whether the system is 32 bit or 64 bit. Although, for a program to actually require 64-bit addressing it would have to have access and use more than 4 GBs of space, which is very unlikely unless you are running a server.
[ November 16, 2005: Message edited by: Scott Selikoff ]

My Blog: Down Home Country Coding with Scott Selikoff
sunil choudhary
Ranch Hand

Joined: Nov 10, 2000
Posts: 138
Thanks scott for the reply,

Can I say that ..
Class file will be able to leverage ALL the benefits of 64 bit architecture without being recompiled in a 64 bit env.


Actually I am talking about server Exactly speakling we are moving our Oracle 11i E Business Suite from 32 bit SOlaris to 64 bit.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24040
    
  13

The Java code will take advantage of the 64 bit architecture if you've got a 64-bit JVM running in 64-bit mode.

Note that Sun's 32-bit JVMs actually have a Java heap limit of about 1855 MB, so anything above that (a limit I've bumped into a number of times in scientific computing applications) and you will benefit from a 64-bit heap.


[Jess in Action][AskingGoodQuestions]
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
Among other things, I support a single Java application (no recompiling) for many architectures, including a few 64-bit architectures. Therefore, there is no need to recompile (in fact, it is impossible since it is ill-defined).


Tony Morris
Java Q&A (FAQ, Trivia)
 
I agree. Here's the link: jrebel
 
subject: Do java classes need to be recompiled for 64 bit O/S
 
Similar Threads
Building appication on 64 bit O.S..Performance issue
Wrapper.Createfile failed with error 1224
64-bit and 32-bit
Eclipse start but return exit code=1
compile 32 bit deploy to 64 bit