Results 1 to 4 of 4
  1. #1
    james12 is offline Member
    Join Date
    Jun 2014
    Posts
    37
    Rep Power
    0

    Default How to find if JVM is 32 or 64 bit from Java program

    hi every one i want to know How to find if JVM is 32 or 64 bit from Java program..can any one tell me this .. thanks in advance

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,346
    Rep Power
    6

    Default Re: How to find if JVM is 32 or 64 bit from Java program

    Same advice as in your other thread: try a google for "java detect 32 or 64 bits". This was the first hit in my case:

    java - How can I tell if I'm running in 64-bit JVM or 32-bit JVM (from within a program)? - Stack Overflow

    All it takes is that you take a moment to think how you formulate the question for Google.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,762
    Blog Entries
    7
    Rep Power
    21

    Default Re: How to find if JVM is 32 or 64 bit from Java program

    @OP (again): don't post these simple homework questions in the Advanced Java forum; I move this thread too; don't do it anymore.

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    Join Date
    Jul 2014
    Location
    United States
    Posts
    7
    Rep Power
    0

    Default Re: How to find if JVM is 32 or 64 bit from Java program

    By using System.getProperty() method, you can find JVM size from java program. Although the size of JVM hardly matters because we know that java is platform independent i.e write once and run everywhere but in some situation it is required to know the size of JVM like if you are using native library. Example of how to get size of JVM.
    System.out.println(System.getProperty("os.arch"));
    System.out.println(System.getProperty("sun.arch.da ta.model"));



    Regards

    [ ad links removed -- mod ]
    Last edited by JosAH; 07-02-2014 at 10:33 AM.

Similar Threads

  1. My program can't find file, even it being there
    By Daniel Silvester in forum New To Java
    Replies: 8
    Last Post: 05-14-2013, 12:01 PM
  2. Could not find the main class: java. Program will exit
    By thewonkits in forum New To Java
    Replies: 3
    Last Post: 01-11-2012, 12:56 PM
  3. Replies: 4
    Last Post: 08-22-2011, 04:42 PM
  4. Find Exact Program name under Java process
    By sjunejo in forum Threads and Synchronization
    Replies: 0
    Last Post: 04-14-2011, 01:20 PM
  5. java program help. find the radius of a circle
    By megironi in forum New To Java
    Replies: 1
    Last Post: 03-27-2009, 08:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •