Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
643 views
in Technique[技术] by (71.8m points)

core - Bundling the JRE with a Java application

I have created an exe with a launch4j Ant script and build.xml file. I want to bundle the JRE in my application and have to distribute it to clients. How do I do this?

Thanks, Rajani

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Well, just bundle everything under $JAVA_HOME/jre into your distribution (presumably a Zip/TAR file) and then have your scripts reference that (i.e. use the java executable under $JRE_HOME/bin to run your java program).

Remember that if you do this, you will have to deliver different distributions for different target platforms (Windows,OSX, linux etc) and architectures (or one bloated uber-distribution of course, but no one will thank you for that!).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...