Public class systempath {public systempath () {} public static string getsyspath () {string Path = thread. currentthread (). getcontextclassloader (). getresource (""). tostring (); string temp = path. replacefirst ("file :/",""). replacefirst ("WEB-INF/classes/", ""); string separator = system. getproperty ("file. separator "); string resultpath = temp. replaceall ("/", (new stringbuilder (string. valueof (separator ))). appe Nd (separator ). tostring (); Return resultpath;} public static string getclasspath () {string Path = thread. currentthread (). getcontextclassloader (). getresource (""). tostring (); string temp = path. replacefirst ("file:/", ""); string separator = system. getproperty ("file. separator "); string resultpath = temp. replaceall ("/", (new stringbuilder (string. valueof (separator ))). append (separator ). tostring (); Return res Ultpath;} public static string getsystemppath () {return system. getproperty ("Java. io. tmpdir ");} public static string getseparator () {return system. getproperty ("file. separator ");} public static void main (string ARGs []) {system. out. println (getsyspath (); system. out. println (system. getproperty ("Java. io. tmpdir "); system. out. println (getseparator (); system. out. println (getclasspath (); // E: \ workspaces \ ZZ \ webroo T \ // C: \ Users \ admini ~ 1 \ appdata \ Local \ temp \ // E: \ workspaces \ ZZ \ webroot \ WEB-INF \ Classes \}}