Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:20
    kunterbunt13 closed #132
  • 13:20
    kunterbunt13 commented #132
  • 12:46
    mordechaim commented #132
  • 12:17
    kunterbunt13 commented #132
  • 11:35
    mordechaim commented #132
  • 11:33
    mordechaim commented #132
  • 07:27
    kunterbunt13 opened #132
  • May 04 13:54

    mordechaim on master

    Credit sponser (compare)

  • Apr 29 12:56
    mordechaim closed #131
  • Apr 20 13:50
    mordechaim commented #131
  • Apr 20 13:48
    kunterbunt13 opened #131
  • Apr 20 12:45
    mordechaim commented #83
  • Apr 20 10:46
    nemphys commented #83
  • Apr 05 18:14
    mordechaim commented #130
  • Apr 03 17:24
    seinecle commented #130
  • Apr 02 17:11
    stirante commented #130
  • Apr 02 15:16
    ttzv commented #130
  • Apr 02 13:53
    mordechaim commented #130
  • Apr 02 13:52
    mordechaim commented #130
  • Apr 02 08:55
    seinecle opened #130
Mordechai Meisels
@mordechaim
Note: Closing the bootstrap window before the business window is open might cause the runtime to exit. Call Platform.setImplicitExit(false) to prevent this, and remember to reset it to true once visible, or call Platform.exit() when you want to terminate.
myteer
@myteer
@mordechaim got it, thanks for your advice.
ddark008
@ddark008
Hello, can I launch app with javaagent with update4j?
Mordechai Meisels
@mordechaim
Yes, they shouldn't conflict in any way.
ddark008
@ddark008
Okey, next level, run app with javaagent on special version jre7?
Or just update and run exe files?
Mordechai Meisels
@mordechaim
Update4j must run on jdk 9+ but you can do the update and then launch a new instance of any jvm or script/executable without update4j at all. As the bullet points in the documentation says, use it for just the update feature.
Something like Runtime.getRuntime().exec()
Mordechai Meisels
@mordechaim
I just opened issue #88 that should make these kind of stuff easier.
mcesar29
@mcesar29
Hi, how can i use it with spring boot application?
hfbanilatq
@hfbanilatq
Hi how can I use it with spring boot too?
mcesar29
@mcesar29
@hfbanilatq can you use it with spring boot application?
Mordechai Meisels
@mordechaim
Yes, it can be used with Spring Boot. Here are a few points to keep in mind:
Spring applications usually don't restart often so you have to be careful to unload old versions on a running instance, follow up if you need assistance on this.
Mordechai Meisels
@mordechaim
Spring loads classes with reflection, and the classloader doesn't always find the new classes dynamically. Refer to the Classloader Model how to mitigate this problem.
eduarddevninja
@eduarddevninja
Hello, can I use update4j in a SWING application?
Mordechai Meisels
@mordechaim
update4j is platform agnostic. You can use it wherever you wish. Just remember to run the update code off the ETD and push visual updates (e.g. from UpdateHandler) through SwingUtilities.invokeLater()
eduarddevninja
@eduarddevninja
Amazing. Thank you
Osiris Team
@Osiris-Team
So Im new to update4j and Im trying to get it, so pls tell me if I got it correctly. I need to have 2 java apps in total. The first one creates the config.xml file and uploads it to the online http server. It contains the information of my 2nd apps latest version. The 2nd is the app that wants to get updated. It gets the latest config.xml from server and compares it with its local(older) config.xml. Then downloads the update. Is that correct?
Mordechai Meisels
@mordechaim
No. You would usually want the build server itself to create the config as part of the build process, since it deals with build artifacts.
The bootstrap/business architecture only comes to play at the client side. The bootstrap reads the config from the server and decides to do whatever you've designed it to do (remember 'create a framework yourself'?).
For ad hoc usage, start with the default bootstrap that lets you focus on the business app only. Run update4j as a jar file to get started.
Osiris Team
@Osiris-Team
Ok because till today I just worked with intellij and build everything localy
Is there any build server u would recommend?
Mordechai Meisels
@mordechaim
A build server is completely optional, local building is fine too. What I'm trying to say is that just like the jars get emitted by the build process, so should the config. Of course nothing keeps you from generating the config manually after each build.
Then, manually upload those files (jars and config) to cloud storage of your choice. Remember to use a canonical url for the config so clients should always point to the newest version.
So, your first comment is technically true.
Osiris Team
@Osiris-Team
Ok one more question. Is there some sheduler which automatically checks for new versions or does this process only happen before startup?
Mordechai Meisels
@mordechaim
Up to you. The default bootstrap does it at startup
Osiris Team
@Osiris-Team
Ok great thx for the help
What about the build server? I think that would make stuff easier right?
Mordechai Meisels
@mordechaim
Hell yes, but as long as you express the config generation directly in Maven/Gradle, the specific server you use doesn't really make a difference. Even local building will have the same results
Osiris Team
@Osiris-Team
So jenkins would be a build server right?
Mordechai Meisels
@mordechaim
Yes.
Travis or GitHub actions work seamlessly on GitHub hosted repos
The beauty of continuous integration is you can define which git branch should build a development build and which should be production. Update4j works very nicely, since you can have any amount of configs at once. Just pull the one you need and that app will run. You might have a dev config or prod config
Osiris Team
@Osiris-Team
Guys I am getting this issue. Any idea why?
: java.lang.IllegalStateException: Checksum of file 'update-AutoPlugLauncher.xml' does not match checksum in configuration. Expected: 5297b893, found: 266eb851
at org.update4j.ConfigImpl.validateFile(ConfigImpl.java:294)
at org.update4j.ConfigImpl.doUpdate(ConfigImpl.java:179)
at org.update4j.Configuration.update(Configuration.java:1016)
at org.update4j.Configuration.update(Configuration.java:944)
at org.update4j.Configuration.update(Configuration.java:855)
at com.osiris.autoplug.launcher.Main.lambda$main$1(Main.java:68)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1764)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1756)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1016)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Failed to download update!
Mordechai Meisels
@mordechaim
The message is in the exception. The checksum doesn't match.
FWIW you shouldn't list the config itself in the config (obviously you already have that file), otherwise you'll get the size and checksum values of the previous config. You are running in a recursive loop.
Osiris Team
@Osiris-Team
ok thx
Osiris Team
@Osiris-Team
Can someone help me? update4j/update4j#100
Mordechai Meisels
@mordechaim
Do you still have any issues? ignoreBootConflict on the file should fix your exception
kvp24
@kvp24
Hello, first of all thank you for an amazing tool!
Currently I have to add updating facility for a legacy java desktop app written with "eclipse SWT" framework. Unfortunately eclipse SWT has different artifacts(jars) for different OS bitness.
Is there any way to define additional information about artifact OS bitness besides OS name ?
Mordechai Meisels
@mordechaim
@kvp24 Unfortunately no, but you can achieve this behavior by using 2 configs where you conditionally decide in the bootstrap which one to use.
kvp24
@kvp24

I did a hack. I wrote OS bitness to commentary field and overrode shouldCheckForUpdate method in UpdateHandler, it's looks working now.

Now I want sign my config. Everything works good with RSA key but if I use ECDSA key I get java.security.NoSuchAlgorithmException: SHA256withEC Signature not available at

Signature sign = Signature.getInstance("SHA256with" + key.getAlgorithm())

this line from ConfigMapper.java:239.
I belive it happens because of naming of algorithms, in java for ECDSA right alg name is "EC" KeyFactory.getInstance("EC") and therefore my key.getAlgorithm() is "EC" and Signature.getInstance("SHA256with" + key.getAlgorithm()) generates "SHA256withEC" instead of "SHA256withECDSA".
Is it bug or feature ?

Mordechai Meisels
@mordechaim
This was fixed in #89. Which version are you using?
kvp24
@kvp24
update4j 1.5.4 with OpenJDK Runtime Environment AdoptOpenJDK (build 15+36)
Mordechai Meisels
@mordechaim
Indeed this is a bug and #89 missed that. Will fix it on next release.
David Metzler
@metzlerd_gitlab
@Thank you for a great tool! @kvp24 I am also working with an old SWT based app. I was wondering if you had to deal with Mac distributions. SWT must run on thread 0 in order to work on a Mac. I'm looking for a way to make sure the Classpath features of update4j would be used but that then we launch the app on thread 0. Have you overcome this limitation?
Mordechai Meisels
@mordechaim

@metzlerd_gitlab I know very little about this but I can tell you that update4j does launch everything in a child thread.

Perhaps you can use update4j as an updater tool and not use the dynamic launch mechanism (i.e. you'll need a new JVM for the launch).