Exception in thread “main“ java.time.DateTimeException: Unable to extract ZoneId from temporal
DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.LONG);
//将日期和时间转成字符串
String format = dtf.format(LocalDateTime.now());
//2020年7月14日 上午10时49分01秒
System.out.println(format);
这段代码在jdk11运行会报错,把环境改为jdk8就可以了
DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.LONG).withZone(ZoneId.systemDefault());
//将日期和时间转成字符串
String format = dtf.format(LocalDateTime.now());
//2020年7月14日 上午10时49分01秒
System.out.println(format);
下面代码在jdk11可以运行
Exception in thread “main“ java.time.DateTimeException: Unable to extract ZoneId from temporal相关推荐
- java.time.DateTimeException: Unable to extract ZoneId from temporal
前言 在学习康师傅的JAVA视频中,发现DateTimeFormatter在高版本JDK(比如:使用JDK14)会报错 问题 java.time.DateTimeException: Unable t ...
- Exception in thread“main“java.lang.IllegalArgument Exception:Unsupported class file major version 58
rt,具体的错误信息如下所示: IDEA.app/Contents/lib/idea_rt.jar=55620:/Applications/IntelliJ IDEA.app/Contents/bin ...
- Exception in thread main java.lang.Error: 无法解析的编译问题: 方法 main 不能声明为 static;只能在静态类型或顶级类型中才能声明静态方法
Exception in thread "main" java.lang.Error: 无法解析的编译问题: 方法 main 不能声明为 static:只能在静态类型或顶级类型中才 ...
- exception in thread main java.lang.noclassdeffounderror wrong name
不含包层次的HelloWorld.java public class HelloWorld{ public static void main(String[] args) { System.out.p ...
- Exception in thread main java.lang.Error: Unresolved compilation problem
初学java,使用eclipse编译时,可能会遇到如下图所示的编译错误(Exception in thread "main" java.lang.Error: Unresolved ...
- list.add时报错:Exception in thread “main“ java.lang.UnsupportedOperationException
用list.add()时报错: Exception in thread "main" java.lang.UnsupportedOperationExceptionat java. ...
- Exception in thread main java.lang.OutOfMemoryError: Java heap space
在做大批量数据测试的时候,服务端初始化出现问题 测试规模,没个站2万点量测数据,整个数据超过20万,初始化过程中对量测数据初始化,按站分别初始化,但是初始化到总数据量10万的时候就会报内存溢出错误. ...
- Exception in thread main java.lang.IncompatibleClassChangeError: net/sf/cglib/core/DebuggingClassW
问题: 今天在运行程序的时候报如下错误. 1. java.lang.NoClassDefFoundError: org/objectweb/asm/CodeVisitor 2. Exception i ...
- Eclipse 报 “Exception in thread main java.lang.OutOfMemoryError: Java heap space ”错误的解决办法
Eclipse 报 "Exception in thread "main" java.lang.OutOfMemoryError: Java heap space &qu ...
最新文章
- 在生产集群上运行topology
- 第一次使用VS Code时你应该知道的一切配置
- YaaS,we can!
- win7 一些快捷系统工具命令
- c语言中listempty函数,list_empty()和list_empty_careful()
- 怎么开启队友无伤_和平精英暗夜危机无敌点位送上!不仅无伤打僵尸 敌人还看不到你...
- win10透明任务栏_TranslucentTB打造win10透明任务栏
- Flex之使用DragManager实现对象拖动
- word20161210
- linux设备驱动编写_tasklet机制
- 全网首发:怎样制作CDKEY(0)-目录
- 管理新语:主管不要当传声筒,要检查、核实
- cl.exe is unable to create an executable file. C compiler test failed.
- 《疯狂的站长》读后感1
- cso是什么职位(企业cso是什么职位)
- Jmeter与搜狗输入法、百度输入法不兼容问题解决方法
- 用keytool生成证书
- VSCode通过源代码管理插件GitLens提交项目代码的过程
- float a=1.0f 中的“f”代表什么
- QQ空间点赞Jquery代码