Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > operation system

Reply
Thread Tools

operation system

 
 
Anabolik
Guest
Posts: n/a
 
      08-10-2009
How to know if the operation system is 32-bit or 64-bit using java?
 
Reply With Quote
 
 
 
 
Eric Sosman
Guest
Posts: n/a
 
      08-10-2009
Anabolik wrote:
> How to know if the operation system is 32-bit or 64-bit using java?


What do you mean by "32-bit or 64-bit?"

Better yet, take a step back and look at the wider issue:
What problem are you trying to solve, what decision are you
trying to make?

Imagine a method

public static int getOSBitness() {
// ... TBD ...
return bits;
}

.... in some class, and we imagine that you can call it and
get a result of 32 or 64 (or maybe something else). What
will your code do differently depending on the result? There
may be a more direct way to make the decision than to try to
infer something from "32-bitness" or "64-bitness."

--
Eric Sosman
http://www.velocityreviews.com/forums/(E-Mail Removed)lid
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      08-10-2009
On Mon, 10 Aug 2009 04:57:14 -0700 (PDT), Anabolik <(E-Mail Removed)>
wrote, quoted or indirectly quoted someone who said :

>How to know if the operation system is 32-bit or 64-bit using java?


see http://mindprod.com/jgloss/wassup.html
http://mindprod.com/jgloss/properties.html

sun.arch.data.model = 32

--
Roedy Green Canadian Mind Products
http://mindprod.com

"We must be very careful when we give advice to younger people: sometimes
they follow it!"
~ Edsger Wybe Dijkstra, born: 1930-05-11 died: 2002-08-06 at age: 72
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      08-10-2009
On Mon, 10 Aug 2009 08:07:52 -0700, Roedy Green
<(E-Mail Removed)> wrote, quoted or indirectly quoted
someone who said :

>>How to know if the operation system is 32-bit or 64-bit using java?

>
>see http://mindprod.com/jgloss/wassup.html
>http://mindprod.com/jgloss/properties.html
>
>sun.arch.data.model = 32


This is whether the Java is 64 bit, which is probably what you really
wanted to know.

Dump out system properties on both a 32 bit and 64 bit OS, and notice
the differences.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"We must be very careful when we give advice to younger people: sometimes
they follow it!"
~ Edsger Wybe Dijkstra, born: 1930-05-11 died: 2002-08-06 at age: 72
 
Reply With Quote
 
Arne Vajh°j
Guest
Posts: n/a
 
      08-23-2009
Roedy Green wrote:
> On Mon, 10 Aug 2009 04:57:14 -0700 (PDT), Anabolik <(E-Mail Removed)>
> wrote, quoted or indirectly quoted someone who said :
>> How to know if the operation system is 32-bit or 64-bit using java?

>
> see http://mindprod.com/jgloss/wassup.html
> http://mindprod.com/jgloss/properties.html
>
> sun.arch.data.model = 32


Question is: will this property exist on all JVM's ?

The name seems to indicate it is SUN specific, but it is present
in IBM and BEA.

Arne
 
Reply With Quote
 
Arne Vajh°j
Guest
Posts: n/a
 
      08-23-2009
Eric Sosman wrote:
> Anabolik wrote:
>> How to know if the operation system is 32-bit or 64-bit using java?

>
> What do you mean by "32-bit or 64-bit?"
>
> Better yet, take a step back and look at the wider issue:
> What problem are you trying to solve, what decision are you
> trying to make?
>
> Imagine a method
>
> public static int getOSBitness() {
> // ... TBD ...
> return bits;
> }
>
> ... in some class, and we imagine that you can call it and
> get a result of 32 or 64 (or maybe something else). What
> will your code do differently depending on the result?


Good question.

A good question that the original poster did not answer.

The real java'ish answer is: nothing.

A "good" Java program will not do different things on 32 bit and
64 bit.

Arne
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Boolean operation and arithmetic operation Buzz Lightyear C++ 10 08-12-2009 01:27 PM
I/O operation, file operation behaviou raan C++ 2 08-16-2007 07:13 PM
Does bit operation always work more efficiently than math operation? david ullua C Programming 13 03-01-2006 11:02 PM
System.WebException | The operation has timed out =?Utf-8?B?U2FjaGluIFN1cmFuYQ==?= ASP .Net 5 02-08-2005 08:03 PM
System.Data.OleDb.OleDbException: Operation must use an updateable query. Mark Sandfox ASP .Net 1 05-03-2004 06:35 PM



Advertisments