当前位置: 首页 > news >正文

hjdang 从jdk11升级到jdk25遇到的问题

1. aspectjweaver-1.8 13 jar invalid cen header (invalid zip64 extra data field size)

The aspectjweaver-1.8.13.jar (and similar older versions like 1.8.9) fails with an "Invalid CEN header (invalid zip64 extra data field size)" error when used with modern JDK versions (JDK 11.0.20+, 17.0.8+, 21, and 22+). This is caused by stricter ZIP64 validation checks introduced by Oracle to prevent security vulnerabilities and ensure adherence to the ZIP specification. 
To resolve this issue, use one of the following solutions:
    • Upgrade AspectJ: The recommended fix is to upgrade to a newer version of AspectJ (e.g., AspectJ 1.9.22.1 or later) that was packaged using tools compliant with the new validation rules.
    • Apply JVM Workaround: You can temporarily disable the strict validation by adding the following flag to your application's startup arguments or Maven/IDE configuration:
      -Djdk.util.zip.disableZip64ExtraFieldValidation=true
      This can be set in environment variables like JAVA_TOOL_OPTIONS or within an application server's setenv file.
    • Downgrade JDK: If an upgrade is not possible, switching back to an older JDK build (e.g., JDK 11.0.19 or earlier) that does not include the JDK-8302483 patch will stop the error.
    • Clean Maven Repository: In some cases, the JAR may be corrupted. Try deleting the org/aspectj/aspectjweaver/1.8.13 directory from your local .m2/repository and re-running your build to force a fresh download. 

 

2. 配置好idea的jdk后,terminl上运行mvn clean install,报错:

cannot find symbol [ERROR] symbol: variable log
In JDK 25 and other modern Java versions (21+), the Maven error cannot find symbol: variable log is typically caused by Lombok not being compatible with the newer compiler or lacking the required annotation processing configuration. 
Core Fixes
  • Enable Stricter Annotation Processing: Starting from JDK 23, you must explicitly enable full annotation processing. Add the <compilerArgs> flag to your maven-compiler-plugin configuration in pom.xml:
    xml
    <plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><configuration><compilerArgs><arg>-proc:full</arg></compilerArgs></configuration>
    </plugin>
    
  • Explicitly Define Annotation Processor Path: Ensure Lombok is defined in the annotationProcessorPaths section of the maven-compiler-plugin:
    xml
    <configuration><annotationProcessorPaths><path><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>1.18.34</version> <!-- Use the latest version for JDK 25 support --></path></annotationProcessorPaths>
    </configuration>
    
     

3. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project api: Fatal error compiling: java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTag :: UNKNOWN

 

The error java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTag :: UNKNOWN typically occurs when you use an outdated version of Lombok with a newer version of the Java Development Kit (JDK). 
This specific TypeTag :: UNKNOWN or TypeTags error is triggered because Lombok relies on internal javac APIs that frequently change in newer JDK releases. When Lombok fails to find a specific field (like UNKNOWN) via reflection, it throws this initialization error. 
 
Immediate Solutions
  • Update Lombok: The most common fix is to update your project's Lombok dependency to the latest version.
    • For JDK 24, you must use Lombok 1.18.38 or higher.
    • For JDK 25, you may need to check for even newer releases or snapshots.
    • Update your pom.xml (Maven) or build.gradle (Gradle) with the latest version from the Project Lombok website.
  • Check JDK Compatibility: Ensure your JAVA_HOME and project language levels match.
    • If you are running an older project (e.g., Java 8) but your system's default JDK is Java 11+, either update the project's dependencies or switch your IDE's Project SDK and JAVA_HOME back to Java 8.
  • Update Maven Compiler Plugin: Sometimes the maven-compiler-plugin version is too old to handle the newer JDK's internal changes. Ensure you are using version 3.10.1 or newer. 
 
Summary Checklist
  1. Update Lombok: Change version to >= 1.18.38 in your build file.
  2. Verify Java Version: Ensure your project's target JDK version is supported by your current Lombok version.
  3. Set Compiler Configuration: If using Maven, ensure the release or source/target flags are correctly set for your JDK. 
 
 
Plugin Icon
 
 
 
Plugin Icon
http://www.jsqmd.com/news/657110/

相关文章:

  • TI DSP 28335 ADC触发机制详解:ePWM SOC与Timer0的实战配置
  • 4/17
  • 告别串口模式:在Ubuntu 22.04上为FTDI芯片安装D2XX驱动,解锁MPSSE高级功能
  • 别再死记硬背BLDC原理了!用Arduino+DRV8313套件,手把手带你玩转无刷电机驱动(附代码)
  • 儿童护眼大路灯哪个牌子好用?全网高赞的护眼大路灯十大品牌排行
  • Windhawk终极指南:轻松定制你的Windows系统体验
  • AI代码迁移实战手册:2026奇点大会未公开的7类Legacy系统适配模板(含Java→Rust/Python→Mojo迁移Checklist)
  • 微服务4:Spring Cloud 微服务实战:如何实现跨服务数据组装?
  • STM32F103待机模式唤醒后程序从头跑?手把手教你用RTC闹钟保存与恢复关键数据
  • DevOps流水线智能化跃迁(2024企业级落地白皮书):基于LLM的代码生成如何降低37%人工干预率?
  • 第N讲:C# 循环实战 从基础for到Razor页面动态渲染(.NET网站开发、C#编程核心)
  • Gemma-3 Pixel Studio应用场景:设计师灵感助手——上传草图→生成配色方案+字体推荐+文案建议
  • Windows优化终极指南:如何用Winhance中文版让你的电脑飞起来 [特殊字符]
  • 告别环境配置焦虑:在Ubuntu 22.04上为ESP32-S3搭建esp-idf v5.4.2的保姆级避坑指南
  • FieldTrip脑电分析:7天从新手到专家的完整实战指南
  • 智能代码生成如何啃下COBOL遗产硬骨头:5个已被验证的迁移模式与避坑清单
  • 从RI-CLPM到传统CLPM:Mplus中交叉滞后模型的选择避坑指南
  • 2026年上海品牌设计公司盘点:如何一眼识别正规军?
  • KISS FFT:轻量级FFT库的终极快速集成指南
  • Vue3数字动画实战:用vue3-count-to打造数据大屏动态效果(附完整代码)
  • Pyecharts树状图实战:从基础布局到高级交互的完整指南
  • 从Nessus到OpenVAS:一个开源漏洞扫描器的‘独立宣言’与实战配置指南
  • 技术解析:从RSSI到CSI,Wi-Fi感知如何突破多径传播的局限
  • 从零到一:基于STM32与SPI Flash的LittleFS移植实战与避坑指南
  • 3步掌握Excalidraw:免费开源虚拟白板的完整使用指南
  • Data Mining: 从介数中心性到模块化,图聚类算法的演进与实战
  • 2026届最火的六大AI论文工具推荐
  • 从SD卡到EMMC:手把手教你用U-Boot的tftp和update_mmc命令完成系统引导迁移
  • 深度解析Elasticsearch REST API:核心优势、工作流程与实战价值
  • LAMMPS在热电材料声子输运模拟中的实践与优化