How to get the current logged in user in Java

To get the current logged in user in Java you can use the following snippet.

Sample Java

System.getProperty("user.name")

Please Share us:
Please rate this snippet

One thought on “How to get the current logged in user in Java

Leave a Reply