Here you can find the source of getRootPath()
public static String getRootPath()
//package com.java2s; //License from project: Open Source License import java.io.File; import java.net.URL; public class Main { public static String ROOT_PATH = null; public static String getRootPath() { if (null != ROOT_PATH) { return ROOT_PATH; }/*from w ww . j a v a2 s . c o m*/ ClassLoader classLoader = Thread.currentThread() .getContextClassLoader(); if (null == classLoader) { classLoader = ClassLoader.getSystemClassLoader(); } URL url = classLoader.getResource("/"); ROOT_PATH = new File(new File(url.getPath() + "/").getParent() + "/").getParent() + "/"; return ROOT_PATH; } }