// /E:/gitSources/myBlog/SpringBoot/target/classes/
    注意把最前面的/去掉
    String path = Thread.currentThread().getContextClassLoader().getResource(“”).getPath();
    String path1 = getClass().getResource(“/“).getPath();
    String path2 = this.getClass().getClassLoader().getResource(“”).getPath();
    String path3 = Blog.class.getResource(“/“).getPath();

    // E:\gitSources\myBlog\SpringBoot
    项目路径
    String rootPath = System.getProperty(“user.dir”);

    // com.myblog.domain
    maven结构Java目录下的第一层
    String path4 = Blog.class.getPackage().getName();
    path4 = path4.replace(“.”, “/“);
    // 获取某个类在classPath中的路径 注意删除/
    // /E:/gitSources/myBlog/SpringBoot/target/classes/com/myblog/domain
    String path0 = Thread.currentThread().getContextClassLoader().getResource(path4).getPath();

    // Blog
    String path5 = Blog.class.getSimpleName();

    // com.myblog.domain.Blog
    String path6 = Blog.class.getName();