How to Find System Info Through Java

Reply

Join Date: Aug 2004
Posts: 350
Reputation: Ghost is an unknown quantity at this point 
Solved Threads: 2
Ghost's Avatar
Ghost Ghost is offline Offline
Posting Whiz

How to Find System Info Through Java

 
0
  #1
Mar 15th, 2005
Hi everybody;

is there a way to find system info (current time, date, processor speed, processor's RPM, Fan1's RPM, Fan2's RPM, etc)?

I am making a program that gives you information about your computer.

Thanx in advanced,
C++
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 53
Reputation: aj.wh.ca is an unknown quantity at this point 
Solved Threads: 1
aj.wh.ca aj.wh.ca is offline Offline
Junior Poster in Training

Re: How to Find System Info Through Java

 
0
  #2
Mar 16th, 2005
Originally Posted by C++
Hi everybody;

is there a way to find system info (current time, date, processor speed, processor's RPM, Fan1's RPM, Fan2's RPM, etc)?

I am making a program that gives you information about your computer.

Thanx in advanced,
C++
Hello,

The basic system info could be fetched using the java.lang.runtime class. It allows you to fetch number of CPU , available memory etc.
Also there is a System class which allows you to check the environmental variables.
Current time and date is easy to fetch using the Date class in java.util
Also if you are not concerned for a generic solution you can always fetch the required info using JNI. (I am not sure but I think the kind of specs you need would only be accessible using JNI)

cheers,
aj.wh.ca
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 350
Reputation: Ghost is an unknown quantity at this point 
Solved Threads: 2
Ghost's Avatar
Ghost Ghost is offline Offline
Posting Whiz

Re: How to Find System Info Through Java

 
0
  #3
Mar 16th, 2005
thank you very much.
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 350
Reputation: Ghost is an unknown quantity at this point 
Solved Threads: 2
Ghost's Avatar
Ghost Ghost is offline Offline
Posting Whiz

Re: How to Find System Info Through Java

 
0
  #4
Mar 16th, 2005
can you please tell me the methods i should use? Thanx
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 350
Reputation: Ghost is an unknown quantity at this point 
Solved Threads: 2
Ghost's Avatar
Ghost Ghost is offline Offline
Posting Whiz

Re: How to Find System Info Through Java

 
0
  #5
Mar 16th, 2005
please regard my last message - i figured it out. Is there a way to find the temperature of the cpu?

thanx
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2,108
Reputation: server_crash is on a distinguished road 
Solved Threads: 18
server_crash server_crash is offline Offline
Postaholic

Re: How to Find System Info Through Java

 
0
  #6
Mar 16th, 2005
Originally Posted by C++
please regard my last message - i figured it out. Is there a way to find the temperature of the cpu?

thanx

Thermometer?
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: How to Find System Info Through Java

 
0
  #7
Mar 16th, 2005
Not unless you use JNI to drive a DLL which calls whatever service your machine has running to measure the CPU temperature.
There may be 3rd party libraries doing at least some of the coding for you.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 350
Reputation: Ghost is an unknown quantity at this point 
Solved Threads: 2
Ghost's Avatar
Ghost Ghost is offline Offline
Posting Whiz

Re: How to Find System Info Through Java

 
0
  #8
Mar 16th, 2005
can u further explain that?

thanx
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 1
Reputation: kanna999666333 is an unknown quantity at this point 
Solved Threads: 0
kanna999666333 kanna999666333 is offline Offline
Newbie Poster

Re: How to Find System Info Through Java

 
0
  #9
May 25th, 2009
send me code which finds sytem information in java
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 13
Reputation: jaka.ramdani is an unknown quantity at this point 
Solved Threads: 2
jaka.ramdani jaka.ramdani is offline Offline
Newbie Poster

Re: How to Find System Info Through Java

 
0
  #10
May 25th, 2009
Originally Posted by kanna999666333 View Post
send me code which finds sytem information in java
try using this:
  1. import java.util.Map.Entry;
  2. import java.util.Properties;
  3. import java.util.Set;
  4.  
  5.  
  6. public class Foo {
  7.  
  8. public static void main(String args[]) {
  9. Properties systemProps = System.getProperties();
  10. Set<Entry<Object, Object>> sets = systemProps.entrySet();
  11. System.out.println("systems properties:");
  12. for(Entry<Object,Object> entry : sets) {
  13. System.out.println("name: " + entry.getKey() + ", value: " + entry.getValue());
  14. }
  15. }
  16. }

in my system, it will print something like these (no masking since i don't think it will endangered me, lol):
  1. systems properties:
  2. name: java.runtime.name, value: Java(TM) SE Runtime Environment
  3. name: sun.boot.library.path, value: C:\DevTools\jdk1.6.0_05\jre\bin
  4. name: java.vm.version, value: 10.0-b19
  5. name: java.vm.vendor, value: Sun Microsystems Inc.
  6. name: java.vendor.url, value: http://java.sun.com/
  7. name: path.separator, value: ;
  8. name: java.vm.name, value: Java HotSpot(TM) Client VM
  9. name: file.encoding.pkg, value: sun.io
  10. name: sun.java.launcher, value: SUN_STANDARD
  11. name: user.country, value: ID
  12. name: sun.os.patch.level, value: Service Pack 2
  13. name: java.vm.specification.name, value: Java Virtual Machine Specification
  14. name: user.dir, value: C:\Projects\personal\manga-downloader
  15. name: java.runtime.version, value: 1.6.0_05-b13
  16. name: java.awt.graphicsenv, value: sun.awt.Win32GraphicsEnvironment
  17. name: java.endorsed.dirs, value: C:\DevTools\jdk1.6.0_05\jre\lib\endorsed
  18. name: os.arch, value: x86
  19. name: java.io.tmpdir, value: C:\DOCUME~1\jaka\LOCALS~1\Temp\
  20. name: line.separator, value:
  21.  
  22. name: java.vm.specification.vendor, value: Sun Microsystems Inc.
  23. name: user.variant, value:
  24. name: os.name, value: Windows XP
  25. name: sun.jnu.encoding, value: Cp1252
  26. name: java.library.path, value: C:\DevTools\jdk1.6.0_05\jre\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\DevTools\jdk1.6.0_05\bin;c:\DevTools\OpenSSL\bin\
  27. name: java.specification.name, value: Java Platform API Specification
  28. name: java.class.version, value: 50.0
  29. name: sun.management.compiler, value: HotSpot Client Compiler
  30. name: os.version, value: 5.1
  31. name: user.home, value: C:\Documents and Settings\jaka
  32. name: user.timezone, value:
  33. name: java.awt.printerjob, value: sun.awt.windows.WPrinterJob
  34. name: file.encoding, value: Cp1252
  35. name: java.specification.version, value: 1.6
  36. name: java.class.path, value: C:\Projects\personal\manga-downloader\lib\htmlcleaner2_0.jar;C:\Projects\personal\manga-downloader\lib\htmlparser.jar;C:\Projects\personal\manga-downloader\lib\js.jar;C:\Projects\personal\manga-downloader\lib\slf4j-api-1.4.3.jar;C:\Projects\personal\manga-downloader\lib\slf4j-simple-1.4.3.jar;C:\Projects\personal\manga-downloader\lib\derbyclient.jar;C:\Projects\personal\manga-downloader\lib\dom4j-1.6.1.jar;C:\Projects\personal\manga-downloader\lib\jaxen-1.1-beta-7.jar;C:\Projects\personal\manga-downloader\lib\jdbc-x.jar;C:\Projects\personal\manga-downloader\lib\log4j-1.2.14.jar;C:\Projects\personal\manga-downloader\lib\slf4j-api-1.5.2.jar;C:\Projects\personal\manga-downloader\lib\slf4j-log4j12-1.5.2.jar;C:\Projects\personal\manga-downloader\build\classes
  37. name: user.name, value: jaka
  38. name: java.vm.specification.version, value: 1.0
  39. name: java.home, value: C:\DevTools\jdk1.6.0_05\jre
  40. name: sun.arch.data.model, value: 32
  41. name: user.language, value: in
  42. name: java.specification.vendor, value: Sun Microsystems Inc.
  43. name: awt.toolkit, value: sun.awt.windows.WToolkit
  44. name: java.vm.info, value: mixed mode, sharing
  45. name: java.version, value: 1.6.0_05
  46. name: java.ext.dirs, value: C:\DevTools\jdk1.6.0_05\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext
  47. name: sun.boot.class.path, value: C:\DevTools\jdk1.6.0_05\jre\lib\resources.jar;C:\DevTools\jdk1.6.0_05\jre\lib\rt.jar;C:\DevTools\jdk1.6.0_05\jre\lib\sunrsasign.jar;C:\DevTools\jdk1.6.0_05\jre\lib\jsse.jar;C:\DevTools\jdk1.6.0_05\jre\lib\jce.jar;C:\DevTools\jdk1.6.0_05\jre\lib\charsets.jar;C:\DevTools\jdk1.6.0_05\jre\classes
  48. name: java.vendor, value: Sun Microsystems Inc.
  49. name: file.separator, value: \
  50. name: java.vendor.url.bug, value: http://java.sun.com/cgi-bin/bugreport.cgi
  51. name: sun.io.unicode.encoding, value: UnicodeLittle
  52. name: sun.cpu.endian, value: little
  53. name: sun.desktop, value: windows
  54. name: sun.cpu.isalist, value: pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86

hope will help ..
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC