Sample Programs

Sample java program to get current working directory

 package org.jusfortechies.example; 

 public class CurrentWorkingDir {

   public static void main(String[] args) {
      
      // System property key to get current working directory. 
      String SYS_PROP_USER_DIR = "user.dir"; 
	
      String currentWorkingDir = System.getProperty(SYS_PROP_USER_DIR); 

      System.out.println("Current Working Directory : " + currentWorkingDir); 
      
   }

 }




blog comments powered by Disqus