在Linux系统上部署Java项目给客户端 [英] Deploying a Java project to client on Linux system
问题描述
.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屋!