This program prints out all system properties : System Properties « Development Class « Java






This program prints out all system properties

 
/*
   This program is a part of the companion code for Core Java 8th ed.
   (http://horstmann.com/corejava)

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

import java.io.IOException;
import java.util.Properties;

/**
 * This program prints out all system properties.
 * @version 1.10 2002-07-06
 * @author Cay Horstmann
 */
public class SystemInfo
{
   public static void main(String args[])
   {
      try
      {
         Properties sysprops = System.getProperties();
         sysprops.store(System.out, "System Properties");
      }
      catch (IOException e)
      {
         e.printStackTrace();
      }
   }
}

   
  








Related examples in the same category

1.Get system properties using System class
2.Get Java specification version using System class
3.Display System PropertiesDisplay System Properties
4.Use System.getenv to get environment variables
5.Machine User NameMachine User Name
6.Get username of system current user
7.Check Version
8.Get Java Runtime Environment (JRE) version?
9.Clear system property: The System.clearProperty() method available in Java 1.5
10.Dealing with the Java environment
11.Get operating system temporary directory / folder
12.List one or more item(s) from System Properties
13.System.setProperty("apple.laf.useScreenMenuBar", "true")
14.Get Java Home directory
15.Determine operating system using System class
16.Setting the Value of a System Property from the Command Line: add -D option to the java command when running your program.
17.Get path / classpath separator
18.Get file separator symbol
19.Get operating system name and version
20.Get user home directory name
21.Set a system property
22.Dump PropsDump Props
23.Get Environment Variables