彻底解决module java.base does not “opens java.io“

  需求背景

最近在使用android studio导入hbuilder的HBuilder-Integrate-AS工程时候报错,错误消息如下两种。

错误描述

第一种

Failed to notify dependency resolution listener.
'void org.gradle.api.artifacts.DependencySubstitutions$Substitution.with(org.gradle.api.artifacts.component.ComponentSelector)'

第二种

Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:

 第三种

HBuilder-Integrate-AS\gradle\wrapper\gradle-wrapper.properties文件里面默认的distributionUrl是6.5.all.zip,或者你导入别的项目,这个url直接连接不到,无法下载。

这个文件拉取直接就是connect filed

第四种

Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @56b5d372

Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @56b5d372

解决方法

拒绝连接可以修改别的gradle的版本,不要直接修改文件,在android studio工具里面修改。

以上的报错都是gradle版本和JDK版本不一致导致的。我这里下载了7.3版本,编译成功。

经过测试===================gradle7.3+jdk11================OK

经过测试===================gradle7.2+jdk11================OK

gradle7+jdk17编译通过无法启动,启动报错。

JDK和Gradle版本对应如下

操作方法

1、修改JDK版本

必须先修改JDK版本,因为修改了Gradle版本,系统会自动重新下载编译。JDK版本参照上图的对应关系。我这里用的JDK17和Gradle 7.3。打开android studio,点击file-Project Structure-SDK Location,然后点击Gradle Settings,然后选择Gradle JDK。

2、修改Gradle版本

打开android studio,点击file-Project Structure-project,然后下拉框修改Gradle Version版本。

结束

-----华丽的分割线,以下是凑字数,大家不用花时间看,快去改代码-----

-----华丽的分割线,以下是凑字数,大家不用花时间看,快去改代码-----

-----华丽的分割线,以下是凑字数,大家不用花时间看,快去改代码-----

package cn.renkai721.bean.vo;import lombok.extern.slf4j.Slf4j;@Slf4j
public class MakeUpTheWordCount {private String make_up_the_word_count_column_999999999_1;private String make_up_the_word_count_column_999999999_2;private String make_up_the_word_count_column_999999999_3;private String make_up_the_word_count_column_999999999_4;private String make_up_the_word_count_column_999999999_5;private String make_up_the_word_count_column_999999999_6;private String make_up_the_word_count_column_999999999_7;private String make_up_the_word_count_column_999999999_8;private String make_up_the_word_count_column_999999999_9;private String make_up_the_word_count_column_999999999_10;private String make_up_the_word_count_column_999999999_11;private String make_up_the_word_count_column_999999999_12;private String make_up_the_word_count_column_999999999_13;private String make_up_the_word_count_column_999999999_14;private String make_up_the_word_count_column_999999999_15;private String make_up_the_word_count_column_999999999_16;private String make_up_the_word_count_column_999999999_17;private String make_up_the_word_count_column_999999999_18;private String make_up_the_word_count_column_999999999_19;private String make_up_the_word_count_column_999999999_20;public String getMake_up_the_word_count_column_999999999_1() {return make_up_the_word_count_column_999999999_1;}public void setMake_up_the_word_count_column_999999999_1(String make_up_the_word_count_column_999999999_1) {this.make_up_the_word_count_column_999999999_1 = make_up_the_word_count_column_999999999_1;}public String getMake_up_the_word_count_column_999999999_2() {return make_up_the_word_count_column_999999999_2;}public void setMake_up_the_word_count_column_999999999_2(String make_up_the_word_count_column_999999999_2) {this.make_up_the_word_count_column_999999999_2 = make_up_the_word_count_column_999999999_2;}public String getMake_up_the_word_count_column_999999999_3() {return make_up_the_word_count_column_999999999_3;}public void setMake_up_the_word_count_column_999999999_3(String make_up_the_word_count_column_999999999_3) {this.make_up_the_word_count_column_999999999_3 = make_up_the_word_count_column_999999999_3;}public String getMake_up_the_word_count_column_999999999_4() {return make_up_the_word_count_column_999999999_4;}public void setMake_up_the_word_count_column_999999999_4(String make_up_the_word_count_column_999999999_4) {this.make_up_the_word_count_column_999999999_4 = make_up_the_word_count_column_999999999_4;}public String getMake_up_the_word_count_column_999999999_5() {return make_up_the_word_count_column_999999999_5;}public void setMake_up_the_word_count_column_999999999_5(String make_up_the_word_count_column_999999999_5) {this.make_up_the_word_count_column_999999999_5 = make_up_the_word_count_column_999999999_5;}public String getMake_up_the_word_count_column_999999999_6() {return make_up_the_word_count_column_999999999_6;}public void setMake_up_the_word_count_column_999999999_6(String make_up_the_word_count_column_999999999_6) {this.make_up_the_word_count_column_999999999_6 = make_up_the_word_count_column_999999999_6;}public String getMake_up_the_word_count_column_999999999_7() {return make_up_the_word_count_column_999999999_7;}public void setMake_up_the_word_count_column_999999999_7(String make_up_the_word_count_column_999999999_7) {this.make_up_the_word_count_column_999999999_7 = make_up_the_word_count_column_999999999_7;}public String getMake_up_the_word_count_column_999999999_8() {return make_up_the_word_count_column_999999999_8;}public void setMake_up_the_word_count_column_999999999_8(String make_up_the_word_count_column_999999999_8) {this.make_up_the_word_count_column_999999999_8 = make_up_the_word_count_column_999999999_8;}public String getMake_up_the_word_count_column_999999999_9() {return make_up_the_word_count_column_999999999_9;}public void setMake_up_the_word_count_column_999999999_9(String make_up_the_word_count_column_999999999_9) {this.make_up_the_word_count_column_999999999_9 = make_up_the_word_count_column_999999999_9;}public String getMake_up_the_word_count_column_999999999_10() {return make_up_the_word_count_column_999999999_10;}public void setMake_up_the_word_count_column_999999999_10(String make_up_the_word_count_column_999999999_10) {this.make_up_the_word_count_column_999999999_10 = make_up_the_word_count_column_999999999_10;}public String getMake_up_the_word_count_column_999999999_11() {return make_up_the_word_count_column_999999999_11;}public void setMake_up_the_word_count_column_999999999_11(String make_up_the_word_count_column_999999999_11) {this.make_up_the_word_count_column_999999999_11 = make_up_the_word_count_column_999999999_11;}public String getMake_up_the_word_count_column_999999999_12() {return make_up_the_word_count_column_999999999_12;}public void setMake_up_the_word_count_column_999999999_12(String make_up_the_word_count_column_999999999_12) {this.make_up_the_word_count_column_999999999_12 = make_up_the_word_count_column_999999999_12;}public String getMake_up_the_word_count_column_999999999_13() {return make_up_the_word_count_column_999999999_13;}public void setMake_up_the_word_count_column_999999999_13(String make_up_the_word_count_column_999999999_13) {this.make_up_the_word_count_column_999999999_13 = make_up_the_word_count_column_999999999_13;}public String getMake_up_the_word_count_column_999999999_14() {return make_up_the_word_count_column_999999999_14;}public void setMake_up_the_word_count_column_999999999_14(String make_up_the_word_count_column_999999999_14) {this.make_up_the_word_count_column_999999999_14 = make_up_the_word_count_column_999999999_14;}public String getMake_up_the_word_count_column_999999999_15() {return make_up_the_word_count_column_999999999_15;}public void setMake_up_the_word_count_column_999999999_15(String make_up_the_word_count_column_999999999_15) {this.make_up_the_word_count_column_999999999_15 = make_up_the_word_count_column_999999999_15;}public String getMake_up_the_word_count_column_999999999_16() {return make_up_the_word_count_column_999999999_16;}public void setMake_up_the_word_count_column_999999999_16(String make_up_the_word_count_column_999999999_16) {this.make_up_the_word_count_column_999999999_16 = make_up_the_word_count_column_999999999_16;}public String getMake_up_the_word_count_column_999999999_17() {return make_up_the_word_count_column_999999999_17;}public void setMake_up_the_word_count_column_999999999_17(String make_up_the_word_count_column_999999999_17) {this.make_up_the_word_count_column_999999999_17 = make_up_the_word_count_column_999999999_17;}public String getMake_up_the_word_count_column_999999999_18() {return make_up_the_word_count_column_999999999_18;}public void setMake_up_the_word_count_column_999999999_18(String make_up_the_word_count_column_999999999_18) {this.make_up_the_word_count_column_999999999_18 = make_up_the_word_count_column_999999999_18;}public String getMake_up_the_word_count_column_999999999_19() {return make_up_the_word_count_column_999999999_19;}public void setMake_up_the_word_count_column_999999999_19(String make_up_the_word_count_column_999999999_19) {this.make_up_the_word_count_column_999999999_19 = make_up_the_word_count_column_999999999_19;}public String getMake_up_the_word_count_column_999999999_20() {return make_up_the_word_count_column_999999999_20;}public void setMake_up_the_word_count_column_999999999_20(String make_up_the_word_count_column_999999999_20) {this.make_up_the_word_count_column_999999999_20 = make_up_the_word_count_column_999999999_20;}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/204582.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

mysql8报sql_mode=only_full_group_by(存储过程一直报)

1:修改数据库配置(重启失效) select global.sql_mode;会打印如下信息 ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION里面包含 ONLY_FULL_GROUP_BY,那么就重新设置,在数据库中输入以下代码,去掉ONLY_FULL_GROU…

UnityShader自定义cginc文件

1.概述 在使用UnityShader开发中,经常需要引入cginc文件,比如UnityCG.cginc。这些文件声明了很多内置的辅助函数和数据结构体,可避免大量重复编码工作。那么在实际开发中其实也需要把一些函数给封装起来,方便调用,那么…

【运维面试100问】(七)ceph基础题面试

本站以分享各种运维经验和运维所需要的技能为主 《python零基础入门》:python零基础入门学习 《python运维脚本》: python运维脚本实践 《shell》:shell学习 《terraform》持续更新中:terraform_Aws学习零基础入门到最佳实战 《k8…

linux下Kafka安装及基本操作

1.下载Kafka http://archive.apache.org/dist/kafka/1.1.0/ 2.解压并重命名 mkdir /usr/local/kafka cd /usr/local tar zxvf kafka_2.12-1.1.0.tgz mv kafka_2.12-1.1.0 ./kafka //把kafka_2.12-1.1.0下的文件拷贝到/usr/local/kafka下面3.配置kafka mkdir /usr/local/kaf…

加密系统,您的数据安全守护者,助您远离泄露风险!

随着云计算、大数据等技术的快速发展,企业在技术升级,业务上云的同时,也面临着来自互联网的各类安全威胁,并且导致数据信息的泄露。企业数据安全问题几乎为新时代人的焦虑又添上了一把火,面对形形色色的网络攻击手段&a…

Python版本与opencv版本的对应关系

python版本要和opencv版本相对应,否则安装的时候会报错。 可以到Links for opencv-python上面查看python版本和opencv版本的对应关系,如图,红框内是python版本,绿框内是opencv版本。 查看自己的python版本后,使用下面…

Linux AMH服务器管理面板本地安装与远程访问

最近,我发现了一个超级强大的人工智能学习网站。它以通俗易懂的方式呈现复杂的概念,而且内容风趣幽默。我觉得它对大家可能会有所帮助,所以我在此分享。点击这里跳转到网站。 文章目录 1. Linux 安装AMH 面板2. 本地访问AMH 面板3. Linux安装…

利用simlink转化HDL-verilog

首先在simlink中找到HDL CODER 打开红色Blank DUT,进入里面绿色的子系统开始设计系统 例如设计一个正弦信号发生器,里面用到了add、memory、relation operator、switch、constant、cos模块,cos模块选择了cordic算法,使用cordic那…

8.2 C++11通用属性

一、编译器的通用属性 随着C语言的演变和编译器的发展,人们常常发现C的标准提供的语言能力不能完全满足要求,因此各大编译器厂商为了满足客户需求,设计出一系列语言扩展来扩展语法,比较常见的就是“属性”。 “属性”是作用于实…

[rk3308]源码编译

执行自动化 ./build.sh (1)报 awk: line 2: function strtonum never defined Build uboot failed!解决 sudo apt install gawk(2)报 /bin/sh: 1: lz4c: not found sudo apt-get install liblz4-tool(3&#xff09…

数组常用方法

1、filter 筛选 筛选数组中带有某个id的对象 let list[{id:1,name:111},{id:2,name:222},{id:3,name:333},]; let alist.filter((item)>{return item.id1 }); console.log(a)2、findIndex var idx list.findIndex((item) > {return item 2;});返回的idx是该元素在数组…

速达软件任意文件上传漏洞复现

简介 速达软件专注中小企业管理软件,产品涵盖进销存软件,财务软件,ERP软件,CRM系统,项目管理软件,OA系统,仓库管理软件等,是中小企业管理市场的佼佼者,提供产品、技术、服务等信息,百万企业共同选择。速达软件全系产品存在任意文件上传漏洞,未经身份认证得攻击者可以通过此漏…

线上超市小程序可以做什么活动_提升用户参与度与购物体验

标题:线上超市小程序:精心策划活动,提升用户参与度与购物体验 一、引言 随着移动互联网的普及,线上购物已经成为人们日常生活的一部分。线上超市作为线上购物的重要组成部分,以其便捷、快速、丰富的商品种类和个性化…

ROS小练习——服务调用

目录 一、服务名称与消息的获取 二、代码案例 1、C 2、python 三、编译运行 1、配置cmakelist 2、运行 一、服务名称与消息的获取 rosservice list rosservice type /spawn rossrv info turtlesim/Spawn 二、代码案例 1、C //包含头文件 #include "ros/ros.h&qu…

Java线程池创建过程

使用线程池提供的构造方法或工厂方法 在 Java 中,创建线程池可以使用 java.util.concurrent.Executors 类中提供的静态方法。以下是线程池的创建过程: 导入必要的类: import java.util.concurrent.ExecutorService; import java.util.concur…

为什么要选择教师这个行业

老师,一个看似平凡却肩负着重大使命的职业,究竟隐藏着怎样的秘密?为什么越来越多的人选择这个行业,又是什么让他们坚持不懈? 实现人生价值 ,我能够通过自己的努力,帮助学生们实现他们的梦想。每…

自动化测试:PO模式详解!

PO(Page Object)模式是一种在自动化测试中常用的设计模式,将页面的每个元素封装成一个对象,通过操作对象来进行页面的交互。 概括来说就是,每个页面都有对应的PO类,PO类中包含了页面的元素定位和操作方法。…

Day43| Leetcode 1049. 最后一块石头的重量 II Leetcode 494. 目标和 Leetcode 474. 一和零

Leetcode 1049. 最后一块石头的重量 II 题目链接 1049 最后一块石头的重量 II 本题思路用一句话概括本题:其实就是尽量让石头分成重量相同的两堆,相撞之后剩下的石头最小。这样一看和前面的题目一个思路了,下面上代码: class S…

uni-app 微信小程序之好看的ui登录页面(三)

文章目录 1. 页面效果2. 页面样式代码 1. 页面效果 2. 页面样式代码 <!-- 简洁登录页面 --> <template><view class"login-bg"><image class"img-a" src"https://zhoukaiwen.com/img/loginImg/bg1.png"></image>…

K8s 多租户方案的挑战与价值

在当今企业环境中&#xff0c;随着业务的快速增长和多样化&#xff0c;服务器和云资源的管理会越来越让人头疼。K8s 虽然很强大&#xff0c;但在处理多个部门或团队的业务部署需求时&#xff0c;如果缺乏有效的多租户支持&#xff0c;在效率和资源管理方面都会不尽如人意。 本…