小工具知识网

当前位置: 首页 > 行业知识 > idea 运行报错:Unrecognized option: --add-opens Error: could not create the java Virtual Machine

行业知识

idea 运行报错:Unrecognized option: --add-opens Error: could not create the java Virtual Machine

2026-10-27 00:20:00 来源:互联网转载

idea突然运行maven test报错

  • 0.背景
  • 1.结论:修改maven-test配置
    • 1.1 不生效的方法:
    • 1.2 实验:
    • 1.3 结论:

      0.背景

      昨天写spring-test运行还好好的,今天来上班突然报错了

      Unrecognized option: --add-opens

      Error: could not create the java Virtual Machine

      Error: A fatal exception has occurred. Program will exit

      1.结论:修改maven-test配置

      1.1 不生效的方法:

      • 重启电脑
      • 重启idea
      • 重置idea-缓存
      • 修改运行参数edit Configurations

        1.2 实验:

        • 网上说、jdk什么的原因,不可能哈,昨天还运行成功尼,我试了一个简单的类只有main方法,可以执行,怀疑是maven-test模块的问题

          1.3 结论:

          • file-》settings-》Build Tools-》maven-》Running Tests-》全都取消勾选

            至此:运行成功。

上一篇:怎么开启云跑步服务器权限?

下一篇:公司网站怎么维护好?