Get the Path of the Home Directory - Java File Path IO

Java examples for File Path IO:Path

Introduction

Create a path that points to the home directory, you can proceed as shown in the following example.

Demo Code


import java.nio.file.Path;
import java.nio.file.Paths;

public class Main {
  public static void main(String[] args) {
    Path path = Paths.get(System.getProperty("user.home"), "downloads",
        "test1.txt");
  }//w ww. j a  v  a 2 s .  c  om
}

Related Tutorials