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

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

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