美文网首页
Intellij IDEA当tomcat容器的多个项目有同名类时

Intellij IDEA当tomcat容器的多个项目有同名类时

作者: fzhyzamt | 来源:发表于2022-03-08 15:46 被阅读0次
    场景

    两个项目,两个类具有完全相同的包名和类名(Fully qualified name)。

    project A
     - com.example.project.Example
    project B
     - com.example.project.Example

    由于java debug时只提供了fqn(此处即:com.example.project.Example),IDEA将无法确定命中的断点究竟是具体的哪一个,所以IDEA将会使用工件中排序靠前的那一个。

    解决方案

    启用如图所示位于"Settings -> Build, Execution, Deployment -> Debugger"的选项“Show alternative source switcher",命中断点时如果IDEA发现有重名的类,就会提示允许你切换。


    image.png
    image.png

    另见

    相关文章

      网友评论

          本文标题:Intellij IDEA当tomcat容器的多个项目有同名类时

          本文链接:https://www.haomeiwen.com/subject/qdparrtx.html