简体   繁体   English

将Java应用程序转换为jar文件

[英]convert java application to a jar file

I developed a java application using swings and servlets(IDE used:Netbeans).I want to convert the java application to a jar file.I have gone through some questions in stackoverflow.I am bit confused between converting java program to jar and .exe,Is there any difference between jar and .exe?? 我使用Swing和Servlets开发了一个Java应用程序(IDE使用了Netbeans)。我想将Java应用程序转换为jar文件。我在stackoverflow中遇到了一些问题。在将Java程序转换为jar和.exe之间有点困惑。 ,jar和.exe有什么区别吗? Finally I want some guidelines to convert java application to jar in NETBEABNS . 最后,我想要一些指南,将NETBEABNS中的 Java应用程序转换为jar。

I have created a jar file for the program-->It fetches data from database and displays to console..When I run the jar file I am getting class notfoundexception:com.mysql.jdbc.Driver..I think jar could not get the driver path..What is the solution?? 我已经为程序创建了一个jar文件->它从数据库中获取数据并显示到控制台。.当我运行jar文件时,我得到的类不是FoundException:com.mysql.jdbc.Driver ..我认为jar无法获取驱动程序路径..解决方案是什么?

If you have servlets, you need to build a war file to deploy to tomcat. 如果您有servlet,则需要构建一个war文件以部署到tomcat。 Netbeeans will help you do that, just make sure you tell it its a web app. Netbeeans将帮助您做到这一点,只需确保将其告知其Web应用即可。

Like DmitryB said, if you are using servlets , you need to generate a war file. 就像DmitryB所说的那样,如果您正在使用servlets ,则需要生成一个war文件。 To generate war file in Netbeans , right click on the project node, select clean and build . 要在Netbeans中生成war文件,请右键单击项目节点,选择clean and build This will generate a war file in the <project_directory>/dist/ directory. 这将在<project_directory>/dist/目录中生成一个war文件。

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

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