title: Getting ClassNotFoundException on standard PMD cyclomatic complexity plug-in
body: <p>I'm using PMD version 6.20.0 on Windows 10, and I'm attempting to use the cyclomatic complexity plug-in on what I would consider simple Java code just to see if things work.  I have a single .java file, CCExample.java, with the code as follows (provided just so everyone can see the source file I'm using, versus asking for comments on the below code which I know is inefficient and only for purposes of an example in an engineering talk I'm giving):</p>
  
  <pre><code>import java.io.*;
  import java.math.*;
  import java.security.*;
  import java.text.*;
  import java.util.*;
  import java.util.concurrent.*;
  import java.util.regex.*;
  
  public class CCExample
  {
      public static String reduceString(String s, int index)
      {
          int lastIndex = s.length() - 1;
  
          if (s.length() == 0)
          {
              return "Empty String";
          }
          else if (index &gt;= lastIndex)
          {
              if (isReduced(s, 0))
              {
                  return s;
              }
              else
              {
                  return reduceString(s, 0);
              }
          }
          else if (s.charAt(index) == s.charAt(index + 1))
          {
              if (index + 1 &lt; lastIndex)
              {
                  return reduceString(s.substring(0, index) + s.substring(index + 2, s.length()), index);
              }
              else
              {
                  return reduceString(s.substring(0, index), index);
              }
          }
          else
          {
              return reduceString(s, index + 1);
          }
      }
  
      public static boolean isReduced(String s, int index)
      {
          int lastIndex = s.length() - 1;
  
          if (index == lastIndex || s.length() == 0)
          {
              return true;
          }
          else if (s.charAt(index) != s.charAt(index + 1))
          {
              return isReduced(s, index + 1);
          }
          else
          {
              return false;
          }
      }
  
      public static void main(final String[] args)
      {
          if (args.length != 1)
          {
              System.out.println("Usage: java CCExample &lt;string&gt;");
          }
          else
          {
              final String s = args[0];
              System.out.println(reduceString(s, 0));
          }
      }
  }
  </code></pre>
  
  <p>With this above single .java file I run the following PMD command:</p>
  
  <pre><code>pmd -d CCExample.java -debug -R category/java/design.xml/CyclomaticComplexity -f text
  </code></pre>
  
  <p>In the debug log I get the following:</p>
  
  <pre><code>Jan 15, 2020 2:35:58 PM net.sourceforge.pmd.RulesetsFactoryUtils printRuleNamesInDebug
  FINER: Loaded rule CyclomaticComplexity
  Jan 15, 2020 2:35:58 PM net.sourceforge.pmd.processor.PmdRunnable call
  FINE: Processing C:\Temp\CCExample.java
  Jan 15, 2020 2:35:58 PM net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver visit
  FINE: Could not find class CCExample, due to: java.lang.ClassNotFoundException: CCExample
  </code></pre>
  
  <p>What am I doing wrong that it cannot find class CCExample?  Some .java files I have I get a cyclomatic complexity numbers, others I get the above error.  Is there some formatting I'm not doing correctly?</p>