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:

Join Our Newsletter

Subscribe to Awesome Java Content

Add Comment

Join Our Newsletter

Subscribe to Awesome Java Content