IDEA 报错:java: 常量字符串过长

IDEA Java About 200 words

错误原因

代码中定义了字符串,超过了65535长度,IDEA编译运行时报错:

java: 常量字符串过长

解决方法

指定Java Compiler,从Javac改为Eclipse即可。

IDEA中打开设置页面,左上角输入框中直接粘贴以下路径即可自动定位到该配置。

Settings | Build, Execution, Deployment | Compiler | Java Compiler
Views: 22 · Posted: 2026-01-14

———         Thanks for Reading         ———

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓
Prev Post
Today In History
Browsing Refresh