java.lang.NoClassDefFoundError:javax / mail / Address错误 [英] java.lang.NoClassDefFoundError: javax/mail/Address error
本文介绍了java.lang.NoClassDefFoundError:javax / mail / Address错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的项目与 lib
文件夹中的 mail.jar
我创建了一个清单文件作为
I have my project with the mail.jar
in the lib
folder. I created a manifest file as
Manifest-Version: 1.0
Main-Class: mainfile
Class-Path: lib/mail.jar
然后我导出了 jar
文件使用eclipse。
I then exported the jar
file using eclipse.
我现在尝试执行jar文件为 java -jar myjar.jar
我收到错误
I tried executing the jar file now as java -jar myjar.jar
and I get the error
java.lang.NoClassDefFoundError: javax/mail/Address
任何指针都将不胜感激
推荐答案
- 在课程路径中添加
mail.jar
- 确保您的类路径中没有打字错误
- 检查导出的
jar
文件,是所有必需的jar都来到那里,如果不是你必须使用eclipse选项将所需的库解压缩到生成的JAR
中。
- Add
mail.jar
in your class path. - Make sure there is no typo in your class path.
- Check exported
jar
file, is all required jar are came there if not you have to use eclipse optionExtract required libraries into generated JAR
.
这篇关于java.lang.NoClassDefFoundError:javax / mail / Address错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文