operation system

E

Eric Sosman

Anabolik said:
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."
 
R

Roedy Green


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
 
A

Arne Vajhøj

Eric said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top