Get file separator symbol
public class Main { public static void main(String[] args) { String dataFolder = System.getProperty("user.dir") + System.getProperty("file.separator") + "data"; System.out.println("Data Folder = " + dataFolder); } }