简体   繁体   English

创建可执行jar文件时出现问题

[英]Troubles while Creating executable jar file

I find out many answers about this question here and on Google but none of them could help me solve my problem. 我在这里和在Google上都找到了有关此问题的许多答案,但没有一个可以帮助我解决问题。

I'm trying to create a executable jar file from a JSE application using Hibernate and others libs... 我正在尝试使用Hibernate和其他库从JSE应用程序创建可执行jar文件...

I already tried using Eclipse's export, FatJar, Prompt and all I get is the same error that is the following 我已经尝试使用Eclipse的导出,FatJar,Prompt,而我得到的只是以下相同的错误

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError:
org/hibernate/cfg/Configuration
at utils.HibernateUtil_XML.<clinit>(HibernateUtil_XML.java:15)

Funny thing that others libraries such as JCalendar is working fine but this one insists. JCalendar之类的其他库也很好用,但是这一点很坚持。

Does anyone have an ideia what the problem could be? 有人对这个问题有什么想法吗?

You should have all dependencies on the classpath when you are running your jar. 运行jar时,应该对类路径具有所有依赖关系。 Exporting to jar is one thing, running it with proper classpath is another. 导出到jar是一回事,以适当的classpath运行它是另一回事。 Look here: How to Set Classpath for Java on Windows Unix and Linux 看这里: 如何在Windows Unix和Linux上为Java设置类路径

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM