Get Started

  1. Add the repository

    Jade artifacts are published to the Jade Maven repository.

    https://jadeframework.net/maven
  2. Add the dependencies

  3. Install the command line tool

    Download jade-cli from Jade repository and add it to your PATH.

  4. Create a component

    Run jade component HelloWorld in your project's package.

    jade-cli requires a pre-existing package-info.java file. If one does not exist, create it before running the above command.

  5. Create a JadeApplication

    This is the entrypoint to your application. The jade-servlet implementation leverage's the servlet container's classpath scanning mechanism to find this class, it need not be registered explicitly.

    import net.jadeframework.jade.JadeApplication;
    import net.jadeframework.jade.JadeElement;
    
    public final class MyJadeApplication implements JadeApplication {
        @Override
        public JadeElement createRootElement() {
            return HelloWorld();
        }
    }
    

    Since this is not a component (it is just an element factory), it is an inconvenient place to construct a view. The suggested approach is for createRootElement to shell out to a "Main" or "Root" component.

  6. Build and deploy

    The suggested approach for building and deploying during development is Gradle and Tomcat.

    Gradle WAR plugin

    Apache Tomcat

    During development Gradle automatically rebuild and redeploy the project when a component is modified. An example of a project that uses this approach can be found in the Jade Git repository. See jade-examples/jade-examples-todo/build.gradle.kts