IDEA错误: 找不到或无法加载主类 com.xxx.freight.dofreight.doFreight解决办法

时间:2023-03-09 16:41:26
IDEA错误: 找不到或无法加载主类 com.xxx.freight.dofreight.doFreight解决办法

1、右键点击工程,选择open Module Settings或点击File选择Project Structure,进入页面

IDEA错误: 找不到或无法加载主类 com.xxx.freight.dofreight.doFreight解决办法

2、选择Artifacts->JAR->From modules with dependencies

IDEA错误: 找不到或无法加载主类 com.xxx.freight.dofreight.doFreight解决办法

3、弹出对话框

为避免出现“错误: 找不到或无法加载主类 com.xxx.freight.dofreight.doFreight”

请按下图步骤打包:

IDEA错误: 找不到或无法加载主类 com.xxx.freight.dofreight.doFreight解决办法

即:

IDEA错误: 找不到或无法加载主类 com.xxx.freight.dofreight.doFreight解决办法

,点击OK,页面显示jar包的输出路径。点击OK,配置完成

IDEA错误: 找不到或无法加载主类 com.xxx.freight.dofreight.doFreight解决办法

4、在idea菜单栏,点击Build->Build Artifacts

IDEA错误: 找不到或无法加载主类 com.xxx.freight.dofreight.doFreight解决办法 ->IDEA错误: 找不到或无法加载主类 com.xxx.freight.dofreight.doFreight解决办法

5、到指定路径 即可获取jar包

IDEA错误: 找不到或无法加载主类 com.xxx.freight.dofreight.doFreight解决办法

打出的包结构为:

IDEA错误: 找不到或无法加载主类 com.xxx.freight.dofreight.doFreight解决办法

------------------------------------------------------Tanwheey--------------------------------------------------

爱生活,爱工作。