0

Finding a peculiar problem. I ran a simple Java Program to find the os.arch version , then I am getting proper X86 architecture with 32 bit , but same when I am running as Jar , I am getting AMD64#64 as output.

Following is the code I am using.

System S.O.P-

  • --- > x86

  • --2---> 32

Running from Eclipse-

enter image description here

import javax.swing.JFrame;
import javax.swing.JOptionPane;


public class CHECK extends JFrame
{
    public CHECK ()
    {
        JOptionPane.showMessageDialog( null, System.getProperty("os.arch")+" # " +System.getProperty("sun.arch.data.model"));


    }


    /**
     * @param args
     */
    public static void main ( String[] args )
    {
        // TODO Auto-generated method stub
        new CHECK();

    }

}

But when I am running as Runnable Jar-

My System details- enter image description here

enter image description here

3
  • 1
    Are you running a 32-bit version of Eclipse? Although it still shouldn't show the os.arch as 32-bits. The amd64 is more correct, although it seems counter intuitive for an intel processor. The architecture is X86_64 actually.
    – Kayaman
    Oct 1, 2013 at 17:04
  • 1
    Is your eclipse 32 or 64 bits, because eclipse is using another JVM (x86), check what is the jdk you are using in the project, change it to use the same from command line and show us the result. Oct 1, 2013 at 17:09
  • 1
    check your eclipse version, if you are using a 32 bit jvm it will be fooled. See this answer to a similar question stackoverflow.com/a/5940770/1424609
    – ctwomey
    Oct 1, 2013 at 17:13

1 Answer 1

0

"os.arch" system property returns the bitness of the JRE, not the OS itself.

from http://mark.koli.ch/2009/10/javas-osarch-system-property-is-the-bitness-of-the-jre-not-the-operating-system.html

This may be happening to you if you are using a 32 bits version of eclipse.

Edit

About the AMD64

86-64 (also known as x64, x86_64 and amd64) is the 64-bit version of the x86 instruction set

From http://en.wikipedia.org/wiki/X86-64

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.