1

I am compiling a Java 11 application, then linking for various architectures by calling the jlink command. Does the architecture of the jmod files used for the javac command affect the output in any way? Is it well-defined behavior to compile (javac) using the Windows jmod files, then link (jlink) using the Linux jmod files?

My intuition is that javac compiles against the interfaces defined within the jmod files, which should match regardless of underlying implementation, but I couldn't find any documentation stating that. For my specific case, I am linking against the OpenJFX library.

Jeff G
  • 4,470
  • 2
  • 41
  • 76
  • 1
    Why do you need such an explicit statement, or in other words, what potential differences are you worrying about? – Holger Oct 04 '18 at 09:01
  • Perhaps my question should be worded differently. Would it be more clear if I asked, "If I compile (`javac`) against the OpenJFX **Windows** JMOD files, then link (`jlink`) against the OpenJFX **Linux** JMOD files, is my application guaranteed to operate identically as it would have had I compiled using the **Linux** JMOD files?" Is that wording more clear? – Jeff G Oct 04 '18 at 20:43
  • It would be a slightly different question, as one question is whether java classes are still compiled against the architecture agnostic API, the other, whether the different JavaFX JMOD files truly offer the same API. The latter depends on the JavaFX maintainers. – Holger Oct 05 '18 at 06:48

0 Answers0