slightly ot: java9 runtime images
Tom Eugelink
tbee at tbee.org
Thu May 14 06:22:39 UTC 2015
Correct. I keep comparing to my appjar tool which, as said before, is a single jar containing all the other jars unmodified. When started through java -jar, it does the following:
- Unpack itself to a temp directory.
- Spawn a new JVM with a classpath referring to all the unpacked stuff.
- The initial JVM is then going into monitor mode, waiting for the spawned JVM to terminate.
- When the spawned JVM terminates, the initial JVM tries to clean up the temp directory.
This works well enough, sometimes the cleanup is a problem with locks preventing deleting, and I'm not too happy that I have to run two JVMs, but that are small issues compared to just being able to release my application by copying a single jar (and not have issues with signed jars). Unfortunately you cannot have the spawned JVM cleanup after itself, otherwise I could stop the initial JVM after it spawned the other.
I figure it should not be that hard to replace the unpack and cleanup logic with native code, and build an EXE that way, so I assumed javafx packager did that. Apparently not. Hmmm, this could of course be a great use case for Go.
And about that Oracle Sales rep, well, you know, I contribute by making my spare time work available for free; I don't know any Oracle sales rep.
Tom
On 13-5-2015 19:09, Danno Ferrin wrote:
> I think what Tom was alluding to was an all in one executable that contains all the data in one file. What the "Windows Application Image" creates is a directory that contains all the jars, the JRE, and the executable that launches the whole setup.
>
> If an all in one executable is something you think will be generally valuable, please let you Oracle Sales rep know so they can pass it down to the PM group so we can get it on the radar.
>
>> On May 13, 2015, at 4:19 AM, Benjamin Gudehus <hastebrot at gmail.com <mailto:hastebrot at gmail.com>> wrote:
>>
>> Hi Tom!
>>
>> >I would really like to be able to generate such a standalone exe.
>>
>> With Danno's javafx-gradle Gradle plugin and with the java package API (com.oracle.tools.packager.Bundler from Java 8) it is possible to generate a standalone exe without installer (the bundler name is "Windows Application Image"). That's the first thing I noticed, when I tested it.
>>
>> Regards,
>> Benjamin
>>
>> On Wed, May 13, 2015 at 11:43 AM, Tom Eugelink <tbee at tbee.org <mailto:tbee at tbee.org>> wrote:
>>
>> On 7-5-2015 15:52, Danno Ferrin wrote:
>>
>> It would be a major improvement (not only for JavaFX applications, but also standalone servers) if it would become possible to create a truly single distributable, without having to repack the jars. So either by automatic unpacking to a tmp and setting the classpath prior to stating java (cleaning up afterwards), or allowing jars-in-jars or jars-in-distributable.
>>
>> In 8u40 we added an option to install your application as service or daemon, so you can use the java packager to install your microsoervices.
>>
>>
>> I've spent some time with the JavaFX packager (though the javafx-maven-plugin) and I am able to generate:
>> - a distribution in the form of a lib directory and entry point jar
>> - an exe & msi that are both installers
>>
>> What I am not able to generate is an exe that can simply be started. Right now my distribution consist of an all-in-one jar (jars-in-a-jar) that can simply be started. The JRE is also simply copied (when not present), so there is no need to install anything, just copy and start. I would really like to be able to generate such a standalone exe. Is this a limitation of the plugin or the packager? Since the plugin seems to be very close to the packager, I'm thinking the latter.
>>
>> Tom
>>
>>
>>
>
More information about the openjfx-dev
mailing list