@Test public void getClassPath(){ ClassLoader loader = Thread.currentThread () .getContextClassLoader (); //Get the current classpath path System.out .println (loader.getResource( "" ) .getPath ()); //Get the current class path System.out .println ( this .getClass().getResource( "" ).getPath()); //Get the current classpath path System.out .println ( this .getClass ().getResource( "/" ).getPath()); // Get user directory System.out.println (System.getProperty( " user.dir " ) ); System.exit(0); }
How to get the path
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=326074184&siteId=291194637
Recommended
Ranking