Use classes in unnamed module that are also contained in a JDK platform/runtime module
Langer, Christoph
christoph.langer at sap.com
Fri Jul 7 06:37:57 UTC 2017
Hi Alex,
> On 7/4/2017 12:02 AM, Langer, Christoph wrote:
> > I have some piece of software that we ship as a jar file and which
> > will hence run on a JDK 9 in the unnamed module. However, this jar
> > file contains a package that is also contained in our JDK image in a
> > module that is always part of the runtime.
>
> It would be remiss of me if I didn't ask for some details about why this
> scenario has arisen. From "always part of the runtime", I would have
> guessed the package is in java.base, but you also mention "our JDK
> image" so perhaps the package is in a module that SAP always jlinks in?
Thanks for your interest in the details. Here it is: We have a separate module that exposes an augmenting SAP specific API which is publicly exported. This module is part of our JDK image. And it in turn pulls a few other modules with the implementing classes and packages. And then we ship a few tools and services apart from the JDK. Some of these are Eclipse based, some of these are standalone. And parts of these tools use the basic classes which are also observable in the JDK. But they need to be there as our tooling should run on any JDK, not only ours.
I think Eclipse-wise we are good, at least when Eclipse runs on Java 8. With the Eclipse classloading, we get the classes out of the plugins. However, since Eclipse is not really mature yet for Java 9, I didn't test there so far. And for the standalone apps, I probably need to look into implementing some custom classloader. I'll try with Alan's suggestions (thanks Alan) but didn't find the time yet.
Thanks & Best regards
Christoph
More information about the jigsaw-dev
mailing list