title: How to specify the Main Class name and provide arguments to my Java program?
body: <p>There is a directory called <code>Programs</code>. Inside that I have my java program called <code>Main.java</code>. I compiled it using this command,</p>
  
  <pre><code>javac Main.java
  </code></pre>
  
  <p>It compiled properly without any errors.</p>
  
  <p>My program takes in three command line arguments. So to run my program in a Linux machine I use this command when I am present inside the <code>Programs</code> directory,</p>
  
  <pre><code>java Main arg1 arg2 arg3
  </code></pre>
  
  <p>That works well.</p>
  
  <p>However if I am in some other directory and try to run this program like,</p>
  
  <pre><code>java /home/Blake/Main arg1 arg2 arg3
  </code></pre>
  
  <p>I am getting an error like this - <code>Error: Could not find or load main class</code> </p>
  
  <p>I tried this command too, but I get same error message:</p>
  
  <pre><code>java -cp /home/Blake/Main arg1 arg2 arg3
  </code></pre>
  
  <p>What am I doing wrong here?</p>
  
  <p>Any input is well appreciated. Thanks!</p>