Jeka follows a specific process before invoking KBean methods :

  1. Parse command line and set system properties.
  2. Set working dir as [project dir]
  3. Augment the current classloader with jar files found in [project dir]/jeka/boot
  4. Parses source files contained in project dir/jeka/def
    1. Detect @JkInjectProject annotations. For each :
      1. Set [project dir] to value declared in annotation
      2. Process steps 3, 4, 5, 6 for the injected project
    2. Augment the current classloader with dependencies declared in source files
  5. Compile files in [project dir]/def/jeka and augment current classloader with compiled files
  6. If compilation fail and command-line option -dci is present, ignore it.
  7. Scan classloader classpath to find KBeans and associate each KBean referenced in command line
  8. Identify the default KBean if any. The default KBean is the first class found in [project dir]/jeka/def extending JkBean.
  9. Instantiate the default KBean. Instantiate means :
    1. Invoke no-arg constructor
    2. Inject KBean properties mentioned in command line
  10. Instantiate other KBean, if not yet done by order they appear in command line.

Once KBeans have been instantiated, KBean methods are executed in order they appear in the command line.


There is only one KBean instance by KBean class and by project.


JkRuntime is the KBean container for a given project. Each KBean instance belongs to a JkRuntime. From JkRuntime, you can access to other KBeans and injected projects.