在Linux系统上部署Java项目给客户端 [英] Deploying a Java project to client on Linux system

查看:204
本文介绍了在Linux系统上部署Java项目给客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个使用Java的项目,现在我必须将它交付给使用Linux的客户端。任何人都可以告诉我哪些可执行文件格式将被传递,以及如何使用?

解决方案

.sh文件是您通常在控制台中键入的命令来运行您的jar文件。它们应该被一个新行分隔开(即每个在.sh文件中的单独一行)。



最基本的可以是将这样的东西添加到你的sh文件:

  java -Xms = 64m -Xmx = 256m -jar myJar.jar -classpath [dependencies dir] / dep1。 jar,[依赖dir] /dep2.jar 

除此之外,你可以做更多异国情调的东西,如parametrise一些环境变量,从.sh启动时得到命令行,并将它们传递给jar执行程序等。查找高级内容的bash脚本:



< a href =http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-2.html#ss2.1 =nofollow> http://tldp.org/HOWTO/Bash-Prog-简介HOWTO-2.html#ss2.1


I'd developed a project using Java and now I've to deliver it to client who is using Linux. Can anybody tell me which executable file format will be delivered and how to make that?

解决方案

Well basically what you wanna put in a .sh file is the commands you'd normally type at the console to run your jar file. They should be separated by a new line (i.e. each on a separate line in the .sh file).

The most basic you can go is add something like this to your sh file:

java -Xms=64m -Xmx=256m -jar myJar.jar -classpath [dependencies dir]/dep1.jar,[dependencies dir]/dep2.jar

beyond this you can do more exotic stuff, like parametrise some environment variables, get command line argumens from when the .sh is launched and pass them to the jar executatble etc. Look up "bash scripting" for advanced stuff:

http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-2.html#ss2.1

这篇关于在Linux系统上部署Java项目给客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆