title: Why I am getting NoClassDefFoundError: org/reactivestreams/Publisher
body: <p>Stream.java</p>
  
  <pre><code>import io.reactivex.*;
  
  
  public class Stream {
  
      public static void main(String args[])
      {
  
        Observable.just("Howdy!").subscribe(System.out::println);
  
      }
  }
  </code></pre>
  
  <p>build.gradle:</p>
  
  <pre><code>group 'com.sakhunzai'
  version '1.0-SNAPSHOT'
  
  apply plugin: 'java'
  
  sourceCompatibility = JavaVersion.VERSION_1_8
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      compile 'io.reactivex.rxjava2:rxjava:2.0.5'
      testCompile group: 'junit', name: 'junit', version: '4.11'
  }
  </code></pre>
  
  <p>Exception:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/reactivestreams/Publisher
  ....
  Caused by: java.lang.ClassNotFoundException: org.reactivestreams.Publisher
  </code></pre>
  
  <p>I am following the <a href="https://www.infoq.com/minibooks/emag-reactive-programming-java" rel="noreferrer">tutorial</a> at page six, except I decided to use gradle instead of maven </p>
  
  <p><strong>Edit</strong></p>
  
  <p>Probably some issue with gradle and Intellij IDEA</p>
  
  <p>Following fixed the issue:
  settings.gradle:</p>
  
  <pre><code>rootProject.name = 'JavaRx'
  
  include "buildSrc"
  </code></pre>