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
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 参数,指定需要使用的模块。
问题已修复,请用新版本 https://github.com/alibaba/druid/releases/tag/1.1.14
原回答者GitHub用户wenshao
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。