Code formatting is a courtesy of the codeformatter.blogspot.
Get user's home directory
Available in gist.
public class test {
public static void main(String[] args) {
String userHome = System.getProperty( "user.home" );
System.out.println( "Home dir: " + userHome );
}
}
Result in Mac OS X 10.7:
Home dir: /Users/username
Home dir: /Users/username
No comments:
Post a Comment