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

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

  •  
  •   raosay92 · Apr 22, 2020 · 2370 views
    This topic created in 2260 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   ·   3178 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 13:19 · PVG 21:19 · LAX 06:19 · JFK 09:19
    ♥ Do have faith in what you're doing.