Applies To : All JDK
Author(s): Biplab Ray
Company: Tata Consultancy Services
Created on: 13th February 2015
Author Bio:
Biplab Ray is working for Tata Consultancy Services as Assistant Consultant and development of SAP EP, composite applications using CAF, BPM, BRM, WebDynpro for Java. He also works in technologies like Java/J2EE and has depth understanding on eSOA, Webservice, Enterprise Service, XML.
Requirement :
In many situation, we might require to know the system configuration.
Implementation:
1. Create one Java class.
And Implementation as below :
import java.util.Properties;
import java.util.Set;
import java.util.Iterator;
public class MyFirstJavaProgram {
public static void main(String []args) {
Properties prop = System.getProperties();
Set<String> set = prop.stringPropertyNames();
Iterator<String> itr = set.iterator();
while(itr.hasNext()){
String string_Key = itr.next();
String string_Value = prop.getProperty(string_Key);
System.out.println(string_Key + " : " + string_Value);
}
}
}
Output Like Below:
java.runtime.name : OpenJDK Runtime Environment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
10 | |
7 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |