1 Problem description

The environment OpenJDK 11 + Gradle , and the dependency of build.gradle is directly introduced into druid , and the error is as follows:

'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

2 Reason analysis

The specific reason can be found in issue , in fact, it is not compatible with JDK11 :

在这里插入图片描述

Since there is no problem with running, then manually solve the compilation problem.

3 problem solving

According to the error prompt of IDEA (specifically varies with the druid version):

~/.gradle/caches/modules-2/files-2.1/com.alibaba/druid/1.2.6/c57198d77a31adf5bd36d35f9b12dc936b732587/druid-1.2.6.pom

Modify the pom file in the prompt:

在这里插入图片描述

Just comment out the above two packages. In druid of the 1.2.6 version, modify line 703 of the pom file and add a comment:

在这里插入图片描述

Re-import the dependencies again and you can see that there is no problem:

在这里插入图片描述


氷泠
420 声望647 粉丝

引用和评论

0 条评论