How to get home directory in java

In this post, we will see how to get user profile’s home directory in java. It is quite simple, we can use System.getProperty(“user.home”) to get it.

Java program:

When I ran above program, I got below output:

Was this post helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *