aspose file tools*
The moose likes Java in General and the fly likes Compiling an application for 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 "Compiling an application for 64-bit" Watch "Compiling an application for 64-bit" New topic
Author

Compiling an application for 64-bit

Charles Owen
Ranch Hand

Joined: Aug 31, 2009
Posts: 61
We have a JDK that's installed in mixed mode, which I assume accommodates both 32-bit and 64-bit applications. Is there something special I need to do in order to compile it as a 64-bit application? Do I create a setting at the ant build file or compiler switch?

Thanks in advance
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14266
    
  21

No. Java bytecode is completely independent of the underlying platform - it doesn't matter if the operating system is 32-bit or 64-bit. There is no 32-bit and 64-bit Java code.

"Mixed mode" does not mean that it accommodates 32-bit and 64-bit applications. It means that it runs in interpreted mode (i.e. your Java byte code is interpreted and executed) as well as JIT-compiled mode (your Java code is translated to native machine code and executed) at the same time; the JIT compiler will decide which parts are worth compiling to native code to make them run faster. This is the normal way that the JVM works. There is a way to run it in purely interpreted mode, but that is normally not useful because it will make your program run very slow.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Charles Owen
Ranch Hand

Joined: Aug 31, 2009
Posts: 61
Thanks for your response. I had asked this because I was asked to compile a Java application to target a 64-bit version of Weblogic or Tomcat. There are 64-bit versions available of these web servers. I just didn't know if I had to do anything on my end to ensure that the application took advantage of the 64-bit web server. The OS I am compiling on is 64-bit SUN Sparc and the JVM is also 64-bit. So I would assume I'm good to go with this.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14266
    
  21

Maybe Weblogic and Tomcat come with some native components that are 32-bit or 64-bit specific, but both these app servers are for the largest part written in Java and are not specific for 32-bit or 64-bit.

For your Java webapp there's absolutely nothing that you'll have to do or change; it doesn't matter if the underlying JVM or OS is 32-bit or 64-bit.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compiling an application for 64-bit