Monday 3 June 2019

How to get the current directory path?


‘System.getProperty("user.dir");’ return the path to the folder, where the application running.

App.java
package com.sample.app;

public class App {

 public static void main(String args[]) {

  String currentdir = System.getProperty("user.dir");
  System.out.print(currentdir);

 }
}


You may like

No comments:

Post a Comment