Results 1 to 1 of 1
Thread: Java system properties
- 02-06-2011, 11:51 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 1
- Rep Power
- 0
Java system properties
I was looking at a post in the Java Tips section which provided some code for viewing system properties. It hard-coded a list of system properties, rather than listing every available property.
I wasn't able to reply to that post, so I'm creating a new thread. For those needing to get a complete list of system properties, you can use the following code (from here).
import java.util.Properties;
import java.util.Enumeration;
public class SysProp {
public static void main(String[] args) {
Properties sysprops = System .getProperties();
Enumeration e = sysprops.propertyNames();
while (e.hasMoreElements()) {
String key = (String)e.nextElement();
String value = sysprops.getProperty(key);
System.out.println(key + "=" + value);
}
}
}
Similar Threads
-
System Properties
By Starvation in forum Advanced JavaReplies: 43Last Post: 06-30-2010, 09:35 AM -
List of System properties
By Java Tip in forum Java TipReplies: 0Last Post: 12-29-2007, 04:56 PM -
Getting System Properties
By Java Tip in forum Java TipReplies: 0Last Post: 11-19-2007, 05:00 PM -
how to use java.util.Properties?
By christina in forum New To JavaReplies: 2Last Post: 08-03-2007, 05:26 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks