When a java project needs to be transfered to another machine, e.g. vps, we need to export it to a runable jar and then run it directly on a new machine.

right click project in eclipse, and export to a runable jar. Choose the second Library handling option and set the entry point with a class including main function. After that, we got a jar file and make sure the libraries are declared in MANIFEST.MF file. Then we need to create a empty folder and copy this jar file along with other resource files (e.g. figures, configuration files) into the folder. Now, we can copy this folder to other machine, and run it with the command: java -jar project.jar.

PS: it is said that if there is no other jar file in the project, then we choose export the java project to a jar. Otherwise, we choose export the java project a runable jar (the library information will be automatically generated in MANIFEST.MF).

export a java project to runable jar的更多相关文章

  1. 将java project打包成jar包,web project 打包成war包的几种演示 此博文包含图片

    转: http://blog.csdn.net/christine_ruan/article/details/7491559 http://developer.51cto.com/art/200907 ...

  2. 将java project打包成jar包,web project 打包成war包的几种演示

    将java项目打包成jar 第一种:MyEclipse将java项目打包成jar. 1,右击项目,选择export . 2,点击Java,选择JAR file . 3,在JAR file文本中浏览打包 ...

  3. java project打包生成jar包(通用)

    1. 在工程目录下新建一个build.xml文件,如下图所示,注意必须是在工程目录下,而不是在工程目录的src目录里. 2.编写ant脚本,内容如下,jar文件名称(com.anllin.rup.bo ...

  4. java项目(java project)如何导入jar包的解决方案列表

    右键项目-properties-java build path(左侧菜单)-选择libraries 有两种方式,导入jar包实际上就是建立一种链接,并不是copy式的导入 一.导入外部包,add ex ...

  5. eclipse项目(java project)如何导入jar包的解决方案列表?

    右键项目-properties-java build path(左侧菜单)-选择libraries 有两种方式,导入jar包实际上就是建立一种链接,并不是copy式的导入 一.导入外部包,add ex ...

  6. 将java项目打包为jar

    打开Eclipse,点击file,选择export 选择java,选择其中的JAR file并点击next 选择需要的到处的项目,并在下方输入将项目保存为的目录,文件名字. 如果,已经将项目打包为一个 ...

  7. Eclipse集成Maven环境(出现jar的解析或者缺失问题)(或者出现Invalid classpath publish/export dependency /common. Project entries not supported)的统一整理

    在正确配置完Maven,和Maven IntegrationFor Eclipse之后,新建了一个Maven Project 和一个Maven Module,发现新建的Module项目下的pom.xm ...

  8. java代码打包成jar以及转换为exe

    教你如何把java代码打包成jar文件以及转换为exe可执行文件 1.背景: 学习java时,教材中关于如题问题,只有一小节说明,而且要自己写麻烦的配置文件,最终结果却只能转换为jar文件.实在是心有 ...

  9. Eclipse将引用了第三方jar包的Java项目打包成jar文件的两种方法

    方案一:用Eclipse自带的Export功能 步骤1:准备主清单文件 “MANIFEST.MF”, 由于是打包引用了第三方jar包的Java项目,故需要自定义配置文件MANIFEST.MF,在该项目 ...

随机推荐

  1. 程序设计入门——C语言 第7周编程练习 2 鞍点(5分)(5分)

    2 鞍点(5分) 题目内容: 给定一个n*n矩阵A.矩阵A的鞍点是一个位置(i,j),在该位置上的元素是第i行上的最大数,第j列上的最小数.一个矩阵A也可能没有鞍点. 你的任务是找出A的鞍点. 输入格 ...

  2. 线性表-双向链表(LinkedList)

    双向链表:如图1-3 所示,会把当前header拆分开,重新插入一个Entry<E>. LinkedList源码 0.首先这个类中的两个变量 private transient Entry ...

  3. Apache 403 error, (13)Permission denied: access to / denied问题

    Apache 配置Alias 后,无法访问 CentOS系统 检查了一圈httpd.conf和目录权限,均没有发现问题. 最后,看了这篇文章,发现是因为系统启动了SELINUX导致的. http:// ...

  4. 【oracle】 oracle学习笔记1--安装与登录

    由于机器配置原因,加上也是自学,所以就没必要安装专业版的oracle,于是就安装的oracle xe版本 下载地址:http://www.oracle.com/technetwork/database ...

  5. call 和 apply使用

      call 和 apply 都是为了改变某个函数运行时的 context 即上下文而存在的,换句话说,就是为了改变函数体内部 this 的指向.因为 JavaScript 的函数存在「定义时上下文」 ...

  6. Python【2】-列表和元组

    一.序列 python包含六种内建的序列:列表.元组.字符串.unicode字符串.buffer对象.xrange对象. 列表可以修改,元组是不能修改的. 二.列表 列表list是变长序列,其中的内容 ...

  7. interface

    接口的简单案例: 接口 就是一种规范 其目的主要是为了约束和解耦 public class Test { public static void main(String[] args){ Compute ...

  8. go语言环境搭建

    1.官网https://golang.org/dl/下载go语言的执行器 2.此处以Windows操作系统上安装go为例,安装go1.7.3.windows-amd64.msi 3.配置go环境变量, ...

  9. Entity Framework – (复数)Plural and (单数)Singular 表名Table names

    By default, the Entity Framework will assume that all of the names of your tables in your database a ...

  10. x64内联汇编注意点

    #include <windows.h> #include <stdio.h> extern "C" int MyPrintf(ULONGLONG,ULON ...