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

Sample Java

System.getProperty("user.name")

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

Leave a Reply