• Post Reply Bookmark Topic Watch Topic
  • New Topic

System (Linux) is 32 or 64 bit?  RSS feed

 
Andrzej Borucki
Ranch Hand
Posts: 90
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How determine from Java is system (Linux) is 32 or 64 bit?
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you specifically want to find that via Java®

System.out.println(System.getProperty("os.version"));
Alternative, added later:-
System.out.println(System.getProperty("os.arch"));
 
Vijitha Kumara
Bartender
Posts: 4002
42
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think "os.arch" would give you JVM architecture not the OS'.

There's a property "sun.arch.data.model" which gives whether 32/64 bit operation according to this.
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijitha Kumara wrote:I think "os.arch" would give you JVM architecture not the OS'. . . .
According to this link, you are correct.

OP: forget about os.arch.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!