The correct way for Java to obtain class path

I want to get the compiled classpath of the project (. / target/classes), write a utility class method, and use ClassLoader.getSystemResource (""). ToString () ) to get it.
it"s no problem to run the project directly, but in the Junit test class, the return value becomes the path in the Junit Jar file, similar to
jar.fileVinceUniqUsersUniq.m2UnipositoryUniqjitplatformUnitable.m2Uniplex repositoryUniplazJunitplatformPlatformUniverse 1.2.0Universe 1.2.0.jartransactions Universe METAINFhand versionsbank 9 / . It"s easy to run the project directly, but in the Jar test class, the return value is changed to the path in the Jar file file, similar to
< jar >.
is it because you ran Junit, during the test, so the class path here becomes its class path? Is there any way to solve it?

Apr.01,2021

System.out.println(" : "+ ToolsApplication.class.getResource("").toString());
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4798a-44c46.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4798a-44c46.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?