开发者社区> 问答> 正文

兼容JDK11了么?

jdk9 以后原来lib下的很多jar包删除了 编译会报一堆错误出来 现在都jdk11了,不准备兼容么?

Errors occurred while build effective model from /Users/Yann/.gradle/caches/modules-2/files-2.1/com.alibaba/druid/1.1.9/e6a9ff9e84dd1c498d9e12373331fbacd92d330a/druid-1.1.9.pom: 'dependencies.dependency.systemPath' for com.alibaba:jconsole:jar must specify an absolute path but is ${env.JAVA_HOME}/lib/jconsole.jar in com.alibaba:druid:1.1.9 'dependencies.dependency.systemPath' for com.alibaba:tools:jar must specify an absolute path but is ${env.JAVA_HOME}/lib/tools.jar in com.alibaba:druid:1.1.9 Errors occurred while build effective model from /Users/Yann/.gradle/caches/modules-2/files-2.1/com.alibaba/druid/1.1.9/e6a9ff9e84dd1c498d9e12373331fbacd92d330a/druid-1.1.9.pom: 'dependencies.dependency.systemPath' for com.alibaba:jconsole:jar must specify an absolute path but is ${env.JAVA_HOME}/lib/jconsole.jar in com.alibaba:druid:1.1.9 'dependencies.dependency.systemPath' for com.alibaba:tools:jar must specify an absolute path but is ${env.JAVA_HOME}/lib/tools.jar in com.alibaba:druid:1.1.9 Errors occurred while build effective model from /Users/Yann/.gradle/caches/modules-2/files-2.1/com.alibaba/druid/1.1.9/e6a9ff9e84dd1c498d9e12373331fbacd92d330a/druid-1.1.9.pom: 'dependencies.dependency.systemPath' for com.alibaba:jconsole:jar must specify an absolute path but is ${env.JAVA_HOME}/lib/jconsole.jar in com.alibaba:druid:1.1.9 'dependencies.dependency.systemPath' for com.alibaba:tools:jar must specify an absolute path but is ${env.JAVA_HOME}/lib/tools.jar in com.alibaba:druid:1.1.9 Errors occurred while build effective model from /Users/Yann/.gradle/caches/modules-2/files-2.1/com.alibaba/druid/1.1.9/e6a9ff9e84dd1c498d9e12373331fbacd92d330a/druid-1.1.9.pom: 'dependencies.dependency.systemPath' for com.alibaba:jconsole:jar must specify an absolute path but is ${env.JAVA_HOME}/lib/jconsole.jar in com.alibaba:druid:1.1.9 'dependencies.dependency.systemPath' for com.alibaba:tools:jar must specify an absolute path but is ${env.JAVA_HOME}/lib/tools.jar in com.alibaba:druid:1.1.9 Errors occurred while build effective model from /Users/Yann/.gradle/caches/modules-2/files-2.1/com.alibaba/druid/1.1.9/e6a9ff9e84dd1c498d9e12373331fbacd92d330a/druid-1.1.9.pom: 'dependencies.dependency.systemPath' for com.alibaba:jconsole:jar must specify an absolute path but is ${env.JAVA_HOME}/lib/jconsole.jar in com.alibaba:druid:1.1.9 'dependencies.dependency.systemPath' for com.alibaba:tools:jar must specify an absolute path but is ${env.JAVA_HOME}/lib/tools.jar in com.alibaba:druid:1.1.9 ... ... ... ... 省略几百行

原提问者GitHub用户yann9

展开
收起
山海行 2023-07-05 19:45:29 93 0
2 条回答
写回答
取消 提交回答
  • 北京阿里云ACE会长

    DK 9以后确实删除了很多库jar包,主要包括:

    -activation.jar

    -jsse.jar

    -tools.jar

    -xml.jar 等等

    这些jar包在JDK8及以前一直是JDK的标准组成部分。

    从JDK 9开始,这些包从JDK默认发布包中删除了,需要单独下载。

    这主要是为了:

    模块化。JDK从9开始采用模块化设计,这些jar包不再归JDK模块管理。

    配合Java模块系统。JDK自身转变为模块化后,这些 jar 不再归 JDK 模块管理。

    减少JDK体积。移除这些 jar 可以大幅减少 JDK 的发布体积。

    对于旧项目编译报错,解决方案有以下几种:

    升级项目到Java 9及以上。尽量使用最新JDK编译,避免依赖这些移除的jar包。

    手动添加 corresponding jar 包。单独下载相应的jar包,添加到项目类路径中。

    使用 --add-modules 参数。在编译命令中加入--add-modules 参数,指定需要使用的模块。

    2023-07-30 15:46:25
    赞同 展开评论 打赏
  • 问题已修复,请用新版本 https://github.com/alibaba/druid/releases/tag/1.1.14

    原回答者GitHub用户wenshao

    2023-07-06 11:04:43
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载