code: public static synchronized String getAbsolutePath(String path) {
  		try {
  			if (rootDir == null) {
  				Class<?> parentClass = getParentClass();
  				String classFile = parentClass.getName().replace('.', '/') + ".class";
  				URL url = parentClass.getResource("/" + classFile);
  				if (url == null) {
  					return null;
  				}
  				if (url.getProtocol().equals("jar")) {
  					rootDir = url.getPath();
  					int i = rootDir.lastIndexOf('!');
  					if (i >= 0) {
  						rootDir = rootDir.substring(0, i);
  					}
  					rootDir = new File(new URL(rootDir).toURI()).getParent();
  				} else {
  					rootDir = new File(url.toURI()).getPath();
  					rootDir = rootDir.substring(0, rootDir.length() - classFile.length());
  					if (rootDir.endsWith(File.separator)) {
  						rootDir = rootDir.substring(0, rootDir.length() - 1);
  					}
  				}
  				rootDir = new File(rootDir).getParent();
  			}
  			return new File(rootDir + File.separator + path).getCanonicalPath();
  		} catch (IOException | URISyntaxException e) {
  			throw new RuntimeException(e);
  		}
  	}
docs: Get the absolute path relative to the current folder,
  which is the parent folder of <b>classpath</b> (<b>classes/</b> or <b>lib/</b>) by default