• 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

system information

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to grab system information like (1)software installed in the system (2)Drivers installed in the system ... etc. using java
 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry! I don't think there are any "direct" way in the current
JAVA API to get the softwares installed and the drivers...
Here is what you can currently do (with my limited knowledge):
List the current system properties:
Properties p = System.getProperties();
p.list(System.out);
Which will result in an output such as:
java.specification.name=Java Platform API Specification
awt.toolkit=sun.awt.windows.WToolkit
java.version=1.2.2
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
user.timezone=America/New_York
java.specification.version=1.2
java.vm.vendor=Sun Microsystems Inc.
user.home=C:\WINNT\Profiles\Serge
java.vm.specification.version=1.0
os.arch=x86
java.awt.fonts=
java.vendor.url=http://java.sun.com/
user.region=US
file.encoding.pkg=sun.io
java.home=C:\Program Files\JavaSoft\JRE\1.2
java.class.path=Classes/idb.jar;Classes/idbf.jar;Clas...
line.separator=
java.ext.dirs=C:\Program Files\JavaSoft\JRE\1.2\lib...
java.io.tmpdir=C:\TEMP\
os.name=Windows NT
java.vendor=Sun Microsystems Inc.
java.awt.printerjob=sun.awt.windows.WPrinterJob
java.library.path=C:\WINNT\system32;.;C:\WINNT\System32...
java.vm.specification.vendor=Sun Microsystems Inc.
sun.io.unicode.encoding=UnicodeLittle
file.encoding=Cp1252
java.specification.vendor=Sun Microsystems Inc.
user.language=en
user.name=Serge
java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport...
java.vm.name=Classic VM
java.class.version=46.0
java.vm.specification.name=Java Virtual Machine Specification
sun.boot.library.path=C:\Program Files\JavaSoft\JRE\1.2\bin
os.version=4.0
java.vm.version=1.2.2
java.vm.info=build JDK-1.2.2_005, native threads, ...
java.compiler=symcjit
path.separator=;
file.separator=\
user.dir=D:\Serge\Langages\Java2
sun.boot.class.path=C:\Program Files\JavaSoft\JRE\1.2\lib...
Or get the curent memory values:Usage:");
Runtime rt = Runtime.getRuntime();
System.out.println("Total Memory = "
+ rt.totalMemory()
+ " Free Memory = "
+ rt.freeMemory());
In addition, you could run the "Set > settings.txt" command
from within your application and then read the settings.txt
file to get the environment settings (assuming you are in a
Windows environment).
Note that if you know of any command in your environment
(Unix, Windows, Mac...) that would display the list of drivers
and softwares loaded and send the output to a text file, you
could also run the command from within your java application,
then read the resulting file.
That's all I can think of and I hope that if there is somebody
else out there that know of other ways to get the results, that
they will let us know.
Thanks.
 
expectation is the root of all heartache - shakespeare. tiny ad:
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!