在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工具包,在这里, ...
随机推荐
- Android 模拟HTTP协议的编码问题 Android默认编码UTF-8
Android通过GET和POST方法请求服务器和浏览器请求的过程是不一样的. 浏览器请求服务器的时候会先将中文进行UTF-8编码,然后再发送到服务器端. Android编程下我们需要通过URLEnc ...
- SQL server 变量、运算符
一.三个表的练习 表一:学生表 student学号:code int (主键)从1开始姓名:name varchar(50)性别:sex char(10)班级:banji char(10)语文教师编号 ...
- [LeetCode#253] Meeting Rooms II
Problem: Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2] ...
- Nginx windows下搭建过程
内容列表: 简要介绍 下载安装 配置测试 一.简要介绍 Nginx ("engine x") 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP ...
- UVa816 Abbott's Revenge
Abbott's Revenge Time limit: 3.000 seconds Abbott’s Revenge Abbott’s Revenge The 1999 World FinalsC ...
- UVA10054 The Necklace
UVA10054 The Necklace 链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=18806 [思路] 欧拉回路 ...
- php 下载
$file='url.xlsx'; if (file_exists(EA_DIR_DATA . $file)) { header('Content-Description: Fi ...
- 【原】Centos6.5下cdh4.6 hive安装部署
1.前提条件: 只需要选择一台服务器即可,这里选择安装在namenode上:安装用户为cloud-user 2.安装包: sudo yum install -y hive hive ...
- C# 中的协变和逆变
作为一个从接触 Unity 3D 才开始学习 C# 的人,我一直只了解一些最基本.最简单的语言特性.最近看了<C# in Depth>这本书,发现这里面东西还真不少,即使除去和 Windo ...
- 在LINUX终端和VIM下复制粘贴
http://www.tinylab.org/linux-terminal-and-paste-copy-under-vim/ 在GUI界面下,我们可以很自由的复制粘贴.但是在字符界面下,我们不得不用 ...