日常之過時bug(java.lang.ClassFormatError: StackMapTable format error)
簡述
一時心血來潮,想編譯個OpenJDK,遇到了幾個編譯錯誤,這很常見。但有個錯誤,比較奇怪。
過程
報錯如下,簡單排查沒有頭緒。
> java -Xms64M -Xmx1600M -cp ... --add-exports ... build.tools.jigsaw.AddPackagesAttribute java-home
< 錯誤: 無法初始化主類 build.tools.jigsaw.AddPackagesAttribute
< 原因: java.lang.ClassFormatError: StackMapTable format error: access beyond the end of attribute
一番摸索,找到幾個線索。
- homebrew/commit/openjdk@21: build with llvm to work around failure on Sequoia
- homebrew/issues/First issues in testing formula builds on Sequoia
- JDK-8340341: Abort in configure when using Xcode 16.0 or 16.1
- developer.apple.com / XCode 16 clang++ compiler generates unexpected results
This is fixed in Xcode 16.2 beta 3 (clang-1600.0.26.6).
去升級!
結論
為保障穩定,請及時升級。(大誤
更多
使用 Xcode 16.3 仍要打 patch。

浙公網安備 33010602011771號