title: How to run a java class on ubuntu?
body: <p>If I compile and run the program. I don't have any issues.</p>
  
  <pre><code>public class HelloWorld {
      public static void main(String[] args) {
          // Prints "Hello, World" to the terminal window.
          System.out.println("Hello, World");
      }
  }
  </code></pre>
  
  <p>If I add the line <code>package ch01.sec01;</code> it complies correctly with <em>javac</em>. However when I try to run it using <code>java</code> I get: </p>
  
  <pre><code>Error: Could not find or load main class HelloWorld
  </code></pre>
  
  <p>I have tried the following.</p>
  
  <pre><code>export CLASSPATH=/usr/lib/jvm/java-9-openjdk-amd64/bin:/usr/lib/jvm/java-1.9.0-openjdk-amd64/bin
  </code></pre>