// 第一种: 2 File f = new File(this.getClass().getResource("/").getPath()); // 结果: /Users/admin/Documents/IdeaProjects/Demo/out/production/Demo System.out.println(f); f = new File(this.getClass().getResource("").getPath()); // 多返回了包名 // 结…
①Migrate project to Gradle? 问题描述: This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system. 解决方法: 一般是粗心大意把整个文件夹给Clone进来啦 所以解决此类问题,一定要看清楚真正的Project,而不是整个文件夹. 或者Android Studio没有配置好Gradle环境(一般在安装A…
最近决定在新WEB项目中使用新的日志系统Log4j2. 官方介绍和学习文档网址为http://logging.apache.org/log4j/2.x/ 首先在WEB项目中引入以下几个jar包: ① log4j-api-2.4.1.jar ② log4j-core-2.4.1.jar ③ log4j-web-2.4.1.jar 按照以往的思路,简单修改web.xml中的Log配置如下: <context-param> <param-name>log4jConfigLocation&…