question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Right way to hand over from JavaFX bootstrap to business app

See original GitHub issue

In the example you have this javafx splash screen example where user launches delegate.jar and it downloads updates and launches business app.

I have build something similar; I have separate Updater app which also functions as installer with javafx gui using update4j-1.2.2.jar, running update logic in different thread and a CustomUpdateHandler updating javafx gui as it goes while showing user info on the currently downloading updates, then after update logic is finished, separate business app in run new jvm and updater does System.exit(0);

I’m wondering if this is an OK way to do it or should I implement it in an other way? Since the updater logic already does an javafx launch I can no longer use Configuration.launch after that am I rite?

Also I’m still a bit unclear on what needs to be done if the updater app itself requires updates, since the updaterapp jar will be locked while it is running.

Runtime run = Runtime.getRuntime(); Process process = run.exec("java -jar BUSINESSAPP.jar"); System.exit(0);

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:71 (32 by maintainers)

github_iconTop GitHub Comments

1reaction
mordechaimcommented, Nov 30, 2018

I am currently working on a demo application that shows many details of update4j. Hope to get it done in a week or 2.

To migrate from standard to delegate mode, all you need is to implement Delegate and move your main method logic in the interface implementation. Next you should ‘advertise’ the delegate as a service provider as explained in the wiki. Make sure the jar is present in the class/module path for the framework to find the delegate.

To implement your own file-download logic, you can override the default logic by implementing the ‘connect()’ method in UpdateHandler. You can then directly pass an instance of the update handler to the Configuration::update method, or provide it as a service.

Btw, I’m planning on renaming the ‘connect()’ method to ‘openDownloadStream()’ on the next release; just be aware of this.

0reactions
mordechaimcommented, Jan 28, 2019

As Christian said, you should use system properties.

if relying on user.dir is to brittle (user might move working directory) you may use user.home plus some known path to your installation.

if you want a platform dependent path, you may use properties (that can specify which OS that property should target) with different values for each operating system (by reusing the same property key and targeting different os) and refer to that property in the base path.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaFX Bootstrap (Part 1/2) - YouTube
Much of this session will draw upon the work in the Pro JavaFX 2 book that Jim Weaver co-authored, as well as the...
Read more >
Bootstrap with JavaFX - Stack Overflow
So to use Bootstrap in JavaFX, use JavaFX's HTML rendering component WebView to render Bootstrap HTML/CSS and JavaScript. Sample Application.
Read more >
BootstrapFX, the early days - No Fluff Just Stuff
Yup, that's right. It's surprising how fast one can change the look of an JavaFX application by using CSS, deceptively fast ;-) ...
Read more >
JavaFX Tutorial - GeeksforGeeks
JavaFX is a Java library and a GUI toolkit designed to develop and facilitate Rich Internet applications, web applications, ...
Read more >
Best JavaFX Libraries for Beautiful Apps and Clean Code
JacpFX is a UI application framework based on JavaFX, supporting developers to structure an application with loosely coupled, reusable ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found