This example show you how to get operating system active user’s login name. We can obtain the username of current user by reading system properties using the user.name
key.
package org.kodejava.lang;
public class GettingUserName {
public static void main(String[] args) {
String username = System.getProperty("user.name");
System.out.println("username = " + username);
}
}
Latest posts by Wayan (see all)
- How do I create a servlet filter to make secure cookies? - April 18, 2024
- How do I configure secure cookies using web.xml? - April 18, 2024
- How do I create a table with multiple header in iText 8? - March 16, 2024