Get the OS Current User Name in Java

This Java tutorial shows how to get current OS user name in Java.

Java makes the operating system's current user name available as the system property user.name. The following code sample shows how to get the user name system property.

String userName = System.getProperty("user.name");


0 comments:

Post a Comment