找不到或无法加载主类

找不到或无法加载主类

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

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

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

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

3、弹出对话框

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

请按下图步骤打包:

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

即:

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

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

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

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

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

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

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

打出的包结构为:

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

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

爱生活,爱工作。

05-11 14:44