java獲取項目classPath路徑

有時候咱們會須要獲取java工程中的classPath路徑,如下方法能夠實現:java Thread.currentThread().getContextClassLoader().getResource("/").getPath() 若是牽涉到跨操做系統,還要進行路徑編碼: URLDecoder.decode(Thread.currentThread().getContextClassLoade
相關文章
相關標籤/搜索