将Java应用程序导出到.JAR文件 [英] Exporting a Java Application to a .JAR file

查看:99
本文介绍了将Java应用程序导出到.JAR文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我已经在Eclipse IDE中构建了一个应用程序.现在,我想部署该应用程序,以便人们可以在其计算机上安装该软件.我相信您可以通过创建一个.JAR文件来实现此目的,就像在使用.exe文件编译基于窗口的程序时一样.

我已经使用Eclipse IDE向导完成了所有步骤,
文件->导出-> Java-> JAR文件等...

然后创建.JAR文件.

现在,我的应用程序通过首先显示屏幕A来工作.此屏幕允许用户输入一些数据.用户插入一些数据后,他们单击一个按钮,然后出现屏幕B.屏幕B取决于用户数据才能运行.

现在,当您双击使用上面提到的向导创建的.JAR文件时,将显示屏幕A,但是当我单击按钮时,屏幕B将不显示.什么都没发生.现在,当我运行该应用程序时,在实际的Eclipse IDE中使用绿色播放(运行)按钮就可以正常工作.

谁能帮我告诉我我做错了吗?
谢谢.

Hello everyone,

I have built an application in Eclipse IDE. Now I want to deploy the application, so people can install the software on their machines. I believe you do this by creating a .JAR file which contains your Java application code within it, like you would if you were compiling a window based program with .exe file.

I have gone through the steps using the Eclipse IDE Wizard,
File -> Export -> Java -> JAR file etc...

And it creates the .JAR file.

Now my application works by first displaying Screen A. This screen lets the users input some data. Once the user has inserted some data, then they click a button and Screen B appears. Screen B depends on the users data in order for it to run.

Now when you double click on the .JAR file created by using the wizard I mentioned above, Screen A displays, however when I click on the button Screen B doesn''t display. Nothing happens. Now when I run the application uses the green play (run) button in the actual Eclipse IDE it works fine.

Can anyone help and tell me what I am doing wrong?
Thank-You.

推荐答案

您的系统中是否有任何日志记录?

似乎应用程序的生命周期与第一个窗口的生命周期有关.是某种登录屏幕吗?

您可能需要在GUI上方使用一些应用程序控制类,以便GUI只是应用程序的一部分,并且关闭窗口并不意味着应用程序结束.
Do you have any logging in your system?

Seems like the lifetime of your application is related to the lifetime of your first window. is that some kind of login screen?

You might need some application controlling classes above the GUI, so that the GUI is just part of the application and the shutdown of a window does not mean the end of the application.


项目中包含的JAR文件.
我决定下载Fat Jar Eclipse插件,并且现在可以使用!
(该插件比Eclipse带来的向导更容易使用).

http://fjep.sourceforge.net/#inst [
I had external JAR files that where included within the project.
I decided to download the Fat Jar Eclipse Plug-In and it works now!
(The plug-in is sooo much easier to use than the wizard Eclipse brings you).

http://fjep.sourceforge.net/#inst[^]


这篇关于将Java应用程序导出到.JAR文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆