在eclipse中将java导出为可执行文件.
Ref: http://java.chinaitlab.com/Eclipse/812775.html and http://www.javavids.com/video/how-to-create-an-executable-jar-file-in-eclipse.html
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 must test run your application in Eclipse. This will create a run configuration, which we'll use later.I have here two applications.One is a console application 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 file and
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 a gui 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 :
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.
在eclipse中将java导出为可执行文件.的更多相关文章
- Eclipse中将项目导出jar包,以及转化成exe的方法
Eclipse中将项目导出jar包,以及转化成exe的方法 http://wenku.baidu.com/view/385597f07c1cfad6195fa7c6.html
- 怎样用Eclipse将Java源代码生成可执行文件[转]
eclipse将java源代码生成jar可执行文件 用eclipse做了一个web项目的自动化测试,自己用的时候倒是很方便,打开eclipse直接运行即可,但是分享给其他小伙伴用的时候就不太方便,希望 ...
- Eclipse中将Java项目转换成Web项目的方法
前言: 用Eclipse开发项目的时候,把一个Web项目导入到Eclipse里会变成了一个java工程,将无法在Tomcat中进行部署运行. 方法: 1.找到.project文件,找到里面的<n ...
- eclipse中将Java项目转换为JavaWeb项目
eclipse导入一些war项目后,会以java项目形式存在,因此我们需要将java项目转换成web项目,不然项目也许会报错. 1.右键已经导入的项目,选择properties. 2.选中projec ...
- Eclipse中将Java项目转换成Web项目的方法(转)
前言: 用Eclipse开发项目的时候,把一个Web项目导入到Eclipse里会变成了一个java工程,将无法在Tomcat中进行部署运行. 方法: 1.找到.project文件,找到里面的<n ...
- eclipse中将java项目变成web项目
今天,用Eclipse开发项目的时候,把一个Web项目导入到Eclipse里会变成了一个java工程,将无法在Tomcat中进行部署运行. 方法: 1.找到.project文件,找到里面的<na ...
- Eclipse中将java类打成jar包形式运行
记录一次帮助小伙伴将java类打成jar包运行 1.创建java project项目 file > new > project > java project 随便起一个项目名称,fi ...
- 使用Eclipse把java文件打包成jar 含有第三方jar库的jar包
使用Eclipse把java文件打包成jar 含有第三方jar库的jar包 网上打包说用eclipse安装fat jar插件,但是貌似现在都不能用了,所以我只能按照eclipse自带的方法打包了. ...
- Eclipse将Java项目打成jar工具包
jar包:就是别人已经写好的一些类,然后将这些类进行打包,你可以将这些jar包引入你的项目中,然后就可以直接使用这些jar包中的类和属性以及方法. jar包可分为可执行jar包和jar工具包,在这里, ...
随机推荐
- 在 ActionBar 添加刷新按钮
在以前版本的 Gmail 应用中,ActionBar 上有个刷新菜单,点击一下刷新菜单变成一个转圈的刷新标示动画图片. 之前实现该功能的时候都是使用一个类库 RefreshActionItem来实现的 ...
- Linux iconv使用
iconv [选项]文件 输入/输出格式规范:-f, --from-code=名称 原始文本编码-t, --to-code=名称 输出编码 信息:-l, --list 列举所有已知的字符集 输出控制: ...
- UVA 586 Instant Complexity
给出一段程序,求运行时间. 现在只考虑一层LOOP,不妨用数组a[i]来表示n的i次方的系数.如果输入OP m,那么就在a[0]上加m,遇到END,就说明循环结束了,需要在系数上乘以循环次数.如果次数 ...
- java.sql.SQLException: Can not issue executeUpdate() for SELECTs
未处理的多个select语句 解决方法就是:查看有没有用了同一个连接来处理多个SQL语句!
- 【HDOJ】3221 Brute-force Algorithm
归来吧很好推导.T(n) = a^f(n-1)*b^f(n)%p.主要难点在于求mod和fibo.引用如下公式A^B%C = A^(B%phi(C) + phi(C))%C, 满足B>=phi( ...
- Delphi WebService 中 Web App Debugger 的建议
NEW一个WEBAPP,选WEBAPPDEBUGGER,输一个COCLASSNAME,比如叫HELLO保存为工程比如叫TEST,UNIT2比如改叫WEBMOD,UNIT1以后没用了,所以还叫UNIT1 ...
- Linux的IP设置参考
位置:etc/network/interfaces 内容: 第一段是网口1自动从DHCP处获得IP 第二段是网口2静态分配IP 如果是IPv6,请把 iface eth0 inet dhcp(stat ...
- Debian添加软件源
安装完渗透测试系统kali linux后,默认的只有security这个源,只更新那些集成的安全软件,不能安装其他新软件,官网给出了3类源: Kali Linux提供了3类软件源,这些源在世界各地都有 ...
- [LeetCode] Distinct Subsequences 解题思路
Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence ...
- Linq to Object实现分页获取数据
最后调用的CSharp代码可以是: int totalcount = dboperator.Customers.Count(); //总记录数 int pagesize = 100;//每页显示数 / ...