環境OpenJDK 11
+Gradle
,直接在build.gradle
中引入druid
的依賴,報錯以下:git
'dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${project.basedir}/lib/openjdk-1.8-tools.jar in com.alibaba:druid:1.2.6 'dependencies.dependency.systemPath' for com.sun:jconsole:jar must specify an absolute path but is ${project.basedir}/lib/openjdk-1.8-jconsole.jar in com.alibaba:druid:1.2.6
具體緣由的話在issue中能夠知道,其實就是沒有兼容JDK11
:github
既然運行沒有問題,那麼就手動解決編譯問題好了。bash
根據IDEA
的錯誤提示(具體因druid
版本而異):gradle
~/.gradle/caches/modules-2/files-2.1/com.alibaba/druid/1.2.6/c57198d77a31adf5bd36d35f9b12dc936b732587/druid-1.2.6.pom
修改提示中的pom
文件:ui
把上面的兩個包註釋掉就能夠了,在1.2.6
版本的druid
中,修改pom
文件的第703行,添加註釋便可:spa
再次從新導入依賴能夠看到沒有問題了:code