Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

CodeFX-org/lab-jigsaw-cyclic-dependencies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lab: Cyclic Modular Dependencies With Project Jigsaw

This demo project contains the code for an answer to a Stack Overflow question. It explores cyclic dependencies With Project Jigsaw.

The code is released into the public domain via CC0 so it can be used without any limitations.

Cycles

We have two disjunct cycles:

  • pair: pair.two requires pair.one requires pair.two
  • triple: triple.three requires triple.two requires triple.one requires triple.three

Running compile.sh shows how they fail:

./compile.sh
 > creating clean directories
 > compiling and packaging cycle "pair"
src/org.codefx.demo.cyclic.pair.one/module-info.java:2: error: cyclic dependence involving org.codefx.demo.cyclic.pair.two
        requires org.codefx.demo.cyclic.pair.two;
                                            ^
1 error
 > compiling and packaging cycle "triple"
src/org.codefx.demo.cyclic.triple.three/module-info.java:2: error: cyclic dependence involving org.codefx.demo.cyclic.triple.two
        requires org.codefx.demo.cyclic.triple.two;
                                              ^
1 error

Setup

The code was developed against build 106 of the Jigsaw early access prototype. For it to work the environment variable JIGSAW_BIN has to point to the bin directory in such a Java 9 install, e.g.:

export JIGSAW_HOME=/opt/java/jdk9
export JIGSAW_BIN=/opt/java/jdk9/bin

About

Toying around with cyclic dependencies in Java 9

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published