Skip to content

Migration to 1.5.x

Mordechai Meisels edited this page Nov 10, 2020 · 8 revisions

Migrating to the new archive-based update is easy; use the UpdateOptions::archive builder to pass all options. You should then remember to install the archive:

// This
boolean success = config.update(myKey, myInjectable);

// And this
Path tempDir = Paths.get("update");
boolean success = config.updateTemp(tempDir, myKey, myInjectable);

// Become
Path zip = Paths.get(""); // you can work with string only too
UpdateResult result = config.update(UpdateOptions.archive(zip)

if(!Files.exists(zip)) // optionally check if anything was downloaded, or nothing changed

if(result.getException() == null) // success;

Additionally, if you use a minified runtime image, you'll have to add the jdk.zipfs module. It is a static required module, meaning it will still run without it, but you can't use the new archive based update model without it being present.