Migration to Java 64 bit

Posted on 2011-10-30
Last Modified: 2012-08-14
Please give me the steps to migrate from 32 bit to 64 bit Java.
OS - Linux
Question by:Raz
    LVL 47

    Accepted Solution

    Do you  mean you have some application to migrate?

    Otherwise you just de-install your 32-bit java and install 64 bit.

    You may not even need to de-install 32-bit; just install 64 bit and point your classpath and sometimes application JAVA_HOME to 64 bit

    It should be rather straightforward, I believe.
    LVL 47

    Expert Comment

    Applications should alos migrate without much problems; unless you have some very special
    bit operations in there.
    LVL 47

    Expert Comment

    LVL 47

    Assisted Solution


    If you don't need java developemnt (for writing new java programs), but just runtime environement, you can download JRE from here:
    LVL 26

    Assisted Solution

    As for_yan says a Java application (JAR file) will generally run just fine in either 32-bit or 64-bit Java.  Install the 64-bit version and run it just as you would the 32-bit.

    The only major thing to watch for is that memory use will generally be higher in the 64-bit version.  This is because every reference now uses 64-bits instead of 32-bits and in a real program that can quickly add up.

    This may mean that you need to start your application with a larger heap than you used for 32-bit.

    LVL 1

    Assisted Solution

    If you're planning to migrate an "application" from 32-bit to 64-bit environment you should consider these facts before -

    1. 64-bit Apps have Wider datapath: The pipe between RAM and CPU is doubled, which improves the performance of memory-bound applications.

    2. 64-bit memory addressing gives virtually unlimited (1 exabyte) heap allocation. However large heaps affect garbage collection.

    3. Applications that run with more than 1.5GB of RAM (including free space for garbage collection optimization) should utilize the 64-bit JVM.

    4. Applications that run on a 32-bit JVM and do not require more than minimal heap sizes will gain nothing from a 64-bit JVM. Barring memory issues, 64-bit hardware with the same relative clock speed and architecture is not likely to run Java applications faster than their 32-bit cousin.

    After this if you do decide to go ahead with the migration, you should follow these simple steps

    1. Firstly get the 64-bit JDK binary and install it on your workstation.

    2. Its preferable to have a 64-bit App/Web Server installed, as they come pre-configured for use with 64-bit JDKs. For 32-bit App Server you need to do some manual changes to JAVA_HOME and CLASSPATH environment variables accordingly.

    3. You would require to rebuild/recompile your app on the new 64-bit JDK

    4. And then comes the worst part of regression testing your app, because 64-bit JVM is still isn't completely stable yet and sometimes does behave a bit unpredictable. But then again there are always some workarounds.

    Happy 64-bit Computing!
    LVL 7

    Assisted Solution

    From development perspective please do consider following things as well:
    1. Is there any external interface providing data through channels like socket or so, the review the code to ensure that the data types marshalling (serialization) is done appropriatly for compatibility issues.
    2. In case you are using any JNI calls, then it will be better if you have those JNI library for 64bit ready, or those will run under compatibility mode with reduced performance.


    Author Comment

    Thank you all for your responses.
    I am trying to make my application use 64 bit JVM.
    Sure let me try installing the jdk.

    Author Comment

    I have installed the jdk, but not able to change the Java_home variable. Please let me know where I need to change this variable.
    I have checked in
    but found nothing.
    OS is Linux
    LVL 10

    Expert Comment

    What shell are you using?  If its bash, try ~/.bash_profile or the various files in /etc/profile.d
    LVL 47

    Assisted Solution

    If you want to set JAVA_HOME for particular user then you do it
    in the .profile in the home directory of the user.
    If you want to change it globally, then in the /etc folder.
    But you may not need to change JAVA_HOME.
    Only some applications are reading it.
    If you didn't have it before chances are maybe you don't need it.
    You need to make sure that in your PATH you have a bin
    folder of your new JDK coming before the bin folder of any other JDK's

    After you have path correctly - run
    java -version
    from your terminal
    SO you'll see that you have new version of java running

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Suggested Solutions

    1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now