You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2003/05/24 17:35:28 UTC

DO NOT REPLY [Bug 20215] New: - System.getProperties()

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20215>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20215

System.getProperties()

           Summary: System.getProperties()
           Product: Ant
           Version: 1.5.3
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: thomas@piratesoft.com


here is the class of printing the system properties

import java.util.*;

public class ListSystemProperties
{
	public static void main(String[] args)
	{
		Properties props = System.getProperties();
		Set keys = new TreeSet(props.keySet()); // for sorting keys
		for ( Iterator i = keys.iterator(); i.hasNext();)
		{
			String key = (String)i.next();
			System.out.println(key + "=" + props.get(key));
		}
	}
}

test build file
<project name="test" default="test" basedir=".">

	<target name="test">
		<java classname="ListSystemProperties" fork="false">
			<classpath>
				<pathelement location="./obj"/>
			</classpath>
		</java>
	</target>

</project>

when fork="false"
	[java] file.encoding=MS950
	[java] user.country=TW
	[java] user.language=zh
	[java] user.timezone=GMT+08:00

when fork="true"
	[java] file.encoding=Cp1252
	[java] user.country=US
	[java] user.language=en
	[java] user.timezone=

some properties is different if non-us locale.
but the system properties should identical either fork is true of false.