zoukankan      html  css  js  c++  java
  • export a java project to runable jar

    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).

  • 相关阅读:
    【JSP】jQuery Deferred exception successed is not defined
    onclick事件传递变量参数&拼接字符串
    JQuery
    设计模式
    拖拽-原型继承案例
    继承
    原型
    闭包
    promise
    jsonp
  • 原文地址:https://www.cnblogs.com/yangzhang/p/4065126.html
Copyright © 2011-2022 走看看