title: Running a java program on command prompt
body: <h2>- Background information:</h2>
  
  <p>I have recently started learning the basics of Java programming language. To run my program at the command prompt, I downloaded the java development kit also known as JDK, and I set my windows 10 system path to:</p>
  
  <blockquote>
    <p>C:\Program Files\Java\jdk-9.0.1\bin;C:\Program
    Files\Java\jre-9.0.1\bin</p>
  </blockquote>
  
  <h2>- Problem:</h2>
  
  <p>After writing a simple Hello World program with the following format:</p>
  
  <pre><code>    class test{
  
          public static void main(String[] args){
  
              System.out.println("Hello World!");
          }
      }
  </code></pre>
  
  <p>and running it on command prompt using </p>
  
  <blockquote>
    <p>javac test.java</p>
  </blockquote>
  
  <p>, and then writing </p>
  
  <blockquote>
    <p>java test</p>
  </blockquote>
  
  <p>the output says: </p>
  
  <blockquote>
    <p>Error: Main method is not static in class test, please define the main
    method as:<br>
    public static void main(String[] args)</p>
  </blockquote>
  
  <p>I have tried compiling my simple program on an online Java compiler and everything works fine.</p>
  
  <h2>- Edit:</h2>
  
  <p>As suggested using a Java decompiler. I used 
  <a href="http://www.javadecompilers.com/result" rel="nofollow noreferrer">http://www.javadecompilers.com/result</a>
   and the output was:</p>
  
  <pre><code>    import java.io.PrintStream;
  
        public class test { 
            public test() {} public void main(String[] paramArrayOfString) { 
                 System.out.println("Hello World!"); 
            }
        }
  </code></pre>
  
  <h2>- Question:</h2>
  
  <p>Where is the problem coming from? How can I fix it?</p>