Bundled app launcher changes (original) (raw)
Igor Nekrestyanov igor.nekrestyanov at oracle.com
Fri Feb 10 23:15:34 PST 2012
- Previous message: Bundled app launcher changes
- Next message: Bundled app launcher changes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
If all elements of the fileset were to be copied to the $JAVAROOT flat (and performing a straight copy of directories), how would you specify which individual files or fileset groups should be included on the classpath? In fact, you do not need this.
Java has support for classpath in the manifest. we should expect that whatever we bundle can start as "java -jar main.jar" I.e. expect executable jar file with classpath in the manifest. This is what any Java IDE or packaging tool (ant, maven, etc.) can produce easily. I would like to hear others opinion about using the Manifest as the authoritative source for the classpath. AFAIK, there isn't any code in the native launching stub today that will pick apart any of the jars to dig around and parse out the Manifest. Perhaps there is a way to make use of the JLI* helper functions? This also raises another point - how do you specify which .jar is the "primary" out of a file set? Simply specifying the main class won't work - so then, should you be able to specify a (perhaps Mac-specific) main class, and still read the classpath information from the Manifest? IMHO, you do not need to dig for manifest. If we expect Class-Path and main class to be in the manifest then in the native launcher you only need to pass a) jvm options (if any) b) jar path/to/main.jar to JVM and it will start the app. No need to set classpath or native lib path.
I'll paste my initial sample below again to answer your other questions.
Specifically here is how can be defined:
i.e. no need to specify main class, etc.
I'm not convinced that the Manifest is a good place to define the classpath, since it cannot be (easily) augmented per-platform ...
BTW, manifest task in ant is quite powerful these days. I believe it can merge existing classpath with classpath in manifest you are adding to jar. See http://ant.apache.org/manual/Tasks/manifest.html
And ant jar task also has some merge support for class path manifests,
-igor
Tentative sample usage (a lot of elements are optional, see simplified sample below):
<properties_ _displayname="SwingSet 2"_ _identifier="com.oracle.javax.swing.SwingSet2"_ _shortversion="1.0"_ _> <property name=":SUFeedURL" value="http://somewhere/sparkle-appcast.xml"/> <fileset .../> Minimal deployment:
- Previous message: Bundled app launcher changes
- Next message: Bundled app launcher changes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]