试了很多种方法,我这种方法在我这好使 System.out.println(this.getClass().getResource("当前类名.class")); 如果输出以“jar”开头,则是为jar包运行