eclipse java可执行文件_在eclipse中将java导出为可执行文件.

Right now your project is bunch of java files in Eclipse. But usually when

you finish your application, you want to create a runnable file, so that

somebody else can execute it. How to do that?

1)First you musttest run your

application in Eclipse. This will create a run configuration,

which we‘lluse later.I

have here two applications.One

is a consoleapplication and the other is

a gui application.To create a runnable file,you must

2)right click your

project and

3)choose export. Choose

4)Runnable Jar

fileand

5)click next. There you must

6)choose your launch configuration, which is the same as

run configuration created earlier.

7)Type export destination jar file. And

choose what to do with libraries, that your application use. I

8)usually choose to copy libraries into a subfolder. Click

finish.Now we‘ll go to the output folder. Here you can run your application in

two ways.

9)If your application is

agui

application, you can click on jar file and it will run.If it‘s a console application, you must open command

line and type java minus jar and jar filename.

for instance, my console app is export to my

path"H:\OwnTool\RemoveFileToDirectory\Mover.jar",so my command prompt is :

1 java -jar H:\OwnTool\RemoveFileToDirectory\Mover.jar

By the way, what is jar file anyway? It‘s an ordinary zip archive,

where are packages with class files and META-INF directory with manifest mf

file. In this file is mainly defined application classpath and a default main

class to execute if you want to run this application.

原文:http://www.cnblogs.com/listened/p/3525372.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值