NetAdminTools.com
 
SignalQ Sites:
NetAdminTools - Coprolite - NoNIC - SpotBridge - NAW
RoboCoop - AreWeDown - SolarPower - SysAdminTools
Xfig - Gold Loaf - GeekPapa - FixGMC - MCJ - FixRambler
Categories:
GNU/Linux | Homebrew designs | Perl | Administration | Backup/Recovery | Bugs/Fixes | Certification | Database | Email | File/Print | Hardware | Information Grab Bag | Interoperability | GNU/Linux ABCs | Monitoring | Name Resolution | Network Services | Networking | Remote Control | Security | Desktop | Web | BSD | Solaris | GIAGD | REALbasic

Last 30 Days | Last 60 Days | Last 90 Days | All Articles | RSS | Hail Support


Categories:
·GNU/Linux
·Homebrew designs
·Perl
·Administration
·Backup/Recovery
·Bugs/Fixes
·Certification
·Database
·Email
·File/Print
·Hardware
·Information Grab Bag
·Interoperability
·GNU/Linux ABCs
·Monitoring
·Name Resolution
·Network Services
·Networking
·Remote Control
·Security
·Desktop
·Web
·BSD
·Solaris
·GIAGD
·REALbasic
·All Categories


Determining System Properties with Java
Topic: Administration   Posted:2005-10-19
Printer Friendly: Print

spacerspacer
In this article we displayed our system properties via Tomcat. We were curious, though, how to retrieve these directly through Java. Here is how you can do this:

[usr-1@srv-1 java]$ cat FirstProperties.java
public class FirstProperties {
public static void main(String[] args) {
System.out.println("System Information: \n");
System.out.println("Operating System: ");
System.out.println(System.getProperty("os.name"));
System.out.println("\nArchitecture: ");
System.out.println(System.getProperty("os.arch"));
System.out.println("\nOperating System Version: ");
System.out.println(System.getProperty("os.version"));
System.out.println("\nJava Virtual Machine Version: ");
System.out.println(System.getProperty("java.vm.version"));
}
}
[usr-1@srv-1 java]$ javac FirstProperties.java
[usr-1@srv-1 java]$ java FirstProperties
System Information:
Operating System:
Linux
Architecture:
i386
Operating System Version:
2.6.9-11.EL
Java Virtual Machine Version:
1.5.0_05-b05
[usr-1@srv-1 java]$





Please read our Terms of Use
Microsoft, Windows, Windows XP, Windows 2003, Windows 2000, and NT are either trademarks or registered trademarks of Microsoft Corporation. NetAdminTools.com is not affiliated with Microsoft Corporation. Linux is a registered trademark of Linus Torvalds, and refers to the Linux kernel. The operating system of most distributions that contain the Linux kernel is GNU/Linux. All logos and trademarks in this site are property of their respective owner. Copyright 1997-2008 NetAdminTools.com

Created by:
MCJ
MCJ CMS