java
宝藏程序员
这个作者很懒,什么都没留下…
展开
-
java sleep println方法对线程间变量的可见性的影响
java sleep println方法对线程间变量的可见性的影响原创 2023-02-07 08:31:50 · 200 阅读 · 0 评论 -
Exception in thread “main“ java.lang.UnsatisfiedLinkError: Unable to load library ‘virt‘
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'virt'原创 2023-01-05 16:52:01 · 1945 阅读 · 0 评论 -
com.fasterxml.jackson.core.JsonParseException: Unrecognized token ‘Alarm‘: was expecting (JSON Stri
nested exception is com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'Alarm': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')原创 2022-12-29 12:01:46 · 14849 阅读 · 0 评论 -
请求报错:Required String parameter ‘id‘ is not present
请求报错:Required String parameter 'id' is not present原创 2022-10-21 15:22:08 · 7858 阅读 · 0 评论 -
java可以开启线程吗?
答案:不可以;原因:java运行在虚拟机上,无法直接操作硬件,在start方法中调用了本地方法start0,通过C++操作底层源码:public synchronized void start() { /** * This method is not invoked for the main method thread or "system" * group threads created/set up by the VM. Any new fun.原创 2022-02-15 10:55:50 · 348 阅读 · 0 评论 -
Cannot get a text value from a numeric cell
通过poi来读取excel文件过程中,通过cell.getStringCellValue()方法尝试从一个数字类型的Cell读取出一个字符串时报错。报错:Exception in thread "main" java.lang.IllegalStateException: Cannot get a text value from a numeric cell at org.apache.poi.xssf.usermodel.XSSFCell.typeMismatch(XSS...原创 2021-12-31 15:03:05 · 966 阅读 · 0 评论 -
The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals
报错:Exception in thread "main" org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of PO原创 2021-12-31 14:29:14 · 2877 阅读 · 0 评论 -
ideaIU-2019.3.3 百度云下载链接
链接:https://pan.baidu.com/s/1awxRcZvJpGHp8YWdc52Rnw提取码:uc4w原创 2021-12-29 09:26:22 · 8526 阅读 · 0 评论 -
java中字符串分割String.split()用法
问题:今天在使用String.split(".")分割字符串时发现得到的字符数组为空解决方法:"."和"|"都需要转义,也就是在前边加上"\\"正确写法:// 使用"."作为分隔:String.split("\\.");// 使用"|"作为分隔:String.split("\\|");...原创 2021-12-09 09:23:52 · 332 阅读 · 2 评论 -
代替ImageIO读取图片的解决方案
报错:ImageIO分析:ImageIO在读取图片时存在问题解决方案:commons-imaging原创 2021-11-05 14:38:13 · 1384 阅读 · 1 评论 -
There was an unexpected error (type=Not Found, status=404)
报错:There was an unexpected error (type=Not Found, status=404)问题:springboot项目启动,访问接口报错,可能时类没有被扫描到解决方法:在application类中添加包扫描,代码如下:@ComponentScan("com.example.*")...原创 2021-10-18 11:24:07 · 584 阅读 · 0 评论 -
设置运行.bat文件后不关闭命令行窗口
解决方法:在bat文件最后一行加上pause或者cmd命令即可效果图:原创 2021-08-25 16:00:58 · 7180 阅读 · 0 评论 -
xxxx.jar中没有主清单属性
报错:C:\Users\xxx\Desktop\java\upload\upload_jar>java -jar upload-1.0-SNAPSHOT.jarxxxx.jar中没有主清单属性过程:在将java maven项目打成jar包并通过java -jar xxx.jar命令运行时报错解决办法:首先通过压缩软件编辑jar包中的MANIFEST.MF文件,添加Main-Class配置项目(见图1),根据自己的工程结构来写(见图2)图1:图2:.原创 2021-08-25 15:12:53 · 325 阅读 · 0 评论 -
Exception in thread “main“ java.lang.NoClassDefFoundError: com/alibaba/fastjson/JSONObject
Exception in thread "main" java.lang.NoClassDefFoundError: com/alibaba/fastjson/JSONObject报错:C:\Users\li\Desktop\java\upload\upload_jar>java -jar upload-1.0-SNAPSHOT.jar......Exception in thread "main" java.lang.NoClassDefFoundError: com/alibab原创 2021-08-25 15:00:59 · 3246 阅读 · 0 评论 -
wait()和sleep()的区别
两者都是线程暂停执行的方法。1.他们来自不同的类,分别是Thread和Object,sleep方法属于Thread类中的静态方法,wait属于Object的成员方法。2.sleep()是线程类(Thread)的方法,不涉及线程通信,调用时会暂停此线程指定的时间,但监控依然保持,不会释放对象锁,到时间自动恢复;wait()是Object的方法,用于线程的通信,调用时会放弃对象锁,进入等待队列,待调用notify()/notifyAll()唤醒指定的线程或者所有线程,才进入对象锁定池准备获得对象锁进入运行状原创 2021-08-11 09:47:14 · 182 阅读 · 0 评论 -
Java取余与求模
区别:对于整型数x,y来说,取模运算或者求余运算的方法都是:1.求整数商:int r = x / y;2.计算模或者余数:int result = x - y * r;求模运算和求余运算在第一步不同:如果r的值时负数且不为整数时,取余运算在取r的值时,向0放行舍入(fix()函数);而取模运算在计算r的值时,向负无穷方向舍入(floor()函数);如果r为整数则没有区别。例如:x = -5 , y = 3 , r = -5 / 3 = -1.66取余时,r = -1 ..原创 2021-06-10 11:40:31 · 852 阅读 · 0 评论