• Post Reply Bookmark Topic Watch Topic
  • New Topic

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: 23329
125
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!