<p>I see many similar questions, however I want to find the Username of the currently logged in user using Java.</p>

<p>Its probably something like:</p>

<pre><code>System.getProperty(current.user);
</code></pre>

<p>But, I'm not quite sure.</p>

[{'answer_id': 31401, 'author': 'Chris Bunch', 'author_id': 422, 'author_profile': 'https://Stackoverflow.com/users/422', 'pm_score': 6, 'selected': True, 'text': '<p>You\'re actually really close. This is what you\'re looking for:</p>\n\n<pre><code>System.getProperty("user.name")\n</code></pre>\n'}, {'answer_id': 41463, 'author': 'John Meagher', 'author_id': 3535, 'author_profile': 'https://Stackoverflow.com/users/3535', 'pm_score': 3, 'selected': False, 'text': '<p>The commonly available system properties are documented in the <a href="http://java.sun.com/javase/6/docs/api/java/lang/System.html#getProperties%28%29" rel="nofollow noreferrer"><code>System.getProperties()</code></a> method.  </p>\n\n<p>As Chris said <code>"user.name"</code> is the property to get the user running your app.</p>\n'}, {'answer_id': 37172080, 'author': 'marklark', 'author_id': 462234, 'author_profile': 'https://Stackoverflow.com/users/462234', 'pm_score': 2, 'selected': False, 'text': '<p>As mentioned above (and linked for Java 6), to get the current user:</p>\n<pre><code>System.getProperty(&quot;user.name&quot;)\n</code></pre>\n<p>For Java 7:  <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#getProperties%28%29" rel="nofollow noreferrer">System.getProperties()</a></p>\n<p>For Java 8:  <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/System.html#getProperties--" rel="nofollow noreferrer">System.getProperties()</a></p>\n<p>For Java 9:  <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/System.html#getProperties--" rel="nofollow noreferrer">System.getProperties()</a></p>\n<p>For Java 10: <a href="https://docs.oracle.com/javase/10/docs/api/java/lang/System.html#getProperties--" rel="nofollow noreferrer">System.getProperties()</a></p>\n<p>For Java 11: <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/System.html" rel="nofollow noreferrer">System.getProperties()</a></p>\n<p>For Java 12: <a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/System.html" rel="nofollow noreferrer">System.getProperties()</a></p>\n<p>For Java 13: <a href="https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/lang/System.html" rel="nofollow noreferrer">System.getProperties()</a></p>\n<p>For Java 14: <a href="https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/lang/System.html" rel="nofollow noreferrer">System.getProperties()</a></p>\n<p>For Java 15: <a href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/System.html" rel="nofollow noreferrer">System.getProperties()</a></p>\n<p>For Java 16: <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/System.html" rel="nofollow noreferrer">System.getProperties()</a></p>\n<p>For Java 17: <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/System.html" rel="nofollow noreferrer">System.getProperties()</a></p>\n'}]
['https://Stackoverflow.com/questions/31394', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2598/']