# Using &binding.impl.name; on JPMS

Java SE 11 features JSR 376 Java Platform Module System. Starting from version 2.3.2 &binding.impl.name; supports JPMS and can be loaded and used from module path. There are only a few things to be aware of.

## &binding.impl.name; classes openness

&binding.impl.name; does reflectively access private members of the class, so client application if loaded from module path needs to "open" packages containing jaxb classes to &binding.spec.name;. There are alternative &binding.spec.name; implementations, having different module names, &binding.spec.name; requires pojo classes to be open only to API module.

JPMS module descriptor opening &binding.spec.name; pojo classes to &binding.spec.name; API

    //JPMS module descriptor
    module com.example.jaxbclasses {

        //Jakarta XML Binding module name
        requires jakarta.xml.bind;

        //open pojo package to make accessing private members possible for &binding.spec.name;.
        opens com.example.jaxbclasses.pojos to jakarta.xml.bind;
    }

&binding.spec.name; API will delegate openness to implementation module after resolving it with service discovery mechanism.

&binding.impl.name; on JPMS Command line examples

    #Both client and &binding.impl.name; on module path:
    $ java -m com.example.jaxbclasses/com.example.jaxb.Main --module-path jaxbclient.jar:jakarta.xml.bind-api.jar:jakarta.activation-api.jar:jaxb-core.jar:jaxb-impl.jar

    #Both client and &binding.impl.name; on classpath:
    $ java com.example.jaxb.Main -cp jaxbclient.jar:jakarta.xml.bind-api.jar:jakarta.activation-api.jar:jaxb-core.jar:jaxb-impl.jar

    #Client on classpath, &binding.impl.name; on module path:
    $ java com.example.jaxb.Main -cp jaxbclient.jar --module-path jakarta.xml.bind-api.jar:jakarta.activation-api.jar:jaxb-core.jar:jaxb-impl.jar --add-modules jakarta.xml.bind

&binding.spec.name; API will delegate openness to implementation module after resolving it with service discovery mechanism.