> On May 27, 2016, at 1:30 AM, Tom Schindl <tom.schi...@bestsolution.at> wrote:
> 
> Do you have an example how to construct such a Layer?


// path is the path to javafx-swt.jar
ModuleFinder finder = ModuleFinder.of(path);
Configuration cf = Layer.boot()
    .configuration()
    .resolveRequires(finder, ModuleFinder.of(), Set.of("javafx.swt"));

// “parent” is the class loader to which SWT types are visible
Layer layer = Layer.boot().defineModulesWithOneLoader(cf, parent);

// the class loader defining javafx.swt module
ClassLoader loader = layer.findLoader("javafx.swt”);

[1] will show more examples of Layer.
Mandy
[1] 
http://hg.openjdk.java.net/jdk9/dev/jdk/file/df35a805b405/test/java/lang/reflect/Layer/LayerAndLoadersTest.java

Reply via email to