• 请不要在回答技术问题时复制粘贴 AI 生成的内容
raosay92
V2EX  ›  程序员

Java 运行时抛出编译的异常,如何解释 the method xxx() is undefined for the type

  •  
  •   raosay92 · Apr 22, 2020 · 2684 views
    This topic created in 2396 days ago, the information mentioned may be changed or developed.
    如题 ,为什么运行时还能抛出编译的错误
    4 replies  •  2020-04-22 20:48:53 +08:00
    xiaoidea
    xiaoidea
    Apr 22, 2020
    1
    编译时包含 /使用某个版本的 jar 依赖,运行环境未必存在该资源或使用的版本和编译时不同
    raosay92
    raosay92
    OP
    Apr 22, 2020
    2
    @xiaoidea 忘了说了单个 jar 运行 依赖的库都是打到 jar 包里面
    pursuer
    pursuer
    Apr 22, 2020
    3
    编译时以来的 class 文件和运行时的 class 文件版本不一致
    guyeu
    guyeu
    Apr 22, 2020
    4
    @raosay92 #2 fat-jar 里可能有同一个类的两个版本
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2059 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 14:48 · PVG 22:48 · LAX 06:48 · JFK 09:48
    ♥ Do have faith in what you're doing.