• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Need some help  RSS feed

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, is it possible for Java to get information such as processor type, cache size, memory size of a computer?
 
author
Sheriff
Posts: 23569
138
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Lin Shen:
Hi, is it possible for Java to get information such as processor type, cache size, memory size of a computer?



There are some simple properties available that you can use -- but nothing major is readily available.

If you are using a J2EE container -- such as Tomcat, Weblogic, JBoss, etc. -- you can always connect to the MBean server to get the information. If you are using Java 5, there are even some internal mbeans that you can access.

Otherwise, you can also call the OS, via a runtime exec, to get the needed information.

Henry
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not with pure Java code. Some system properties are available, like os.arch, os.name, os.version and sun.cpu.endian, that may help you.
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The System properties also usually have some helpful tidbits.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!