问题:当在IDEA中执行含main方法的java程序时,IDEA报找不到或无法加载主类。 记录一下解决方法: 1、试invalid cache and restart。 我执行了,没能解决,不适用我的情况 2、delete target文件夹 重新maven编译, 执行了,不适用 3、检查edit configuration 中main class 检查了,和预期的相符。 我的解决方法: 在edit configuration 中勾选 include dependencies with “Provided” scope