Java: Packaging Applications?

Status
Not open for further replies.

sorghumking

Ars Scholae Palatinae
989
I wrote a Java application that I'd like to run on any machine that has the appropriate Java Runtime Environment installed. I'm used to running apps via the SDK binaries, i.e. "java [application]" from the command line. How exactly do I package my application so it can run on machines that only have the JRE installed? I couldn't find much of use with Google, so I'm at a loss.
 

t3chi3

Wise, Aged Ars Veteran
134
Go to java.sun.com and look for help on java utilities such as jar. What you want to do is create a jar containing your entire classpath of your sourcecode. You will also need a manifest file to be included in that jar what will describe which source class is the main class for the execution entry point. The user would simply double click the jar file and the java code will execute.

t3chi3
 

reboot

Ars Legatus Legionis
10,818
Actually, reboot, you would be bereaking Sun's license agreement for both the JRE and SDK if you included java.exe with your application.

wrong.

License to Distribute Software. Subject to the terms and conditions of this Agreement, including, but not limited to Section 4 (Java (TM) Technology Restrictions) of these Supplemental Terms, Sun grants you a non-exclusive, non-transferable, limited license to reproduce and distribute the Software in binary code form only, provided that (i) you distribute the Software complete and unmodified and only bundled as part of, and for the sole purpose of running, your Programs, (ii) the Programs add significant and primary functionality to the Software, (iii) you do not distribute additional software intended to replace any component(s) of the Software, (iv) you do not remove or alter any proprietary legends or notices contained in the Software

or put more clearly :

The J2SE SDK and the JRE can also be freely redistributed, provided that it is distributed with a value-add application or applet

linkage
 
Status
Not open for further replies.