[Java/IDE] IDEA运行Java类时报错:Error running 'MainTest': Command line is too long. Shorten command line for MainTest or also for Application default configuration

报错原因

IDEA运行Java类时报错:Error running 'MainTest': Command line is too long. Shorten command line for MainTest or also for Application default configuration

Java项目启动命令过长。

解决方法

方法1

  • (点击)项目启动配置项 -> (勾选) shorten command line 选项
  • (选择) classpath file java manifest 选项
  • 重新启动工程运行即可

方法2

未亲测

  • 修改工作空间

  • 在文件中搜索
  • 添加属性:"dynamic.classpath": "true"

配置完重启即可

参考文献

posted @ 2020-07-03 13:52  千千寰宇  阅读(1361)  评论(0)    收藏  举报