title: Ant - Java command - IllegalAccessException
body: <p>I need to run java class using ant. But when i run a class file, it throws IllegalAccessException.</p>
  
  <p>this is my ant code:</p>
  
  <pre><code>&lt;target name="test"&gt;
  
      &lt;java classname="A" classpath="."&gt;
      &lt;/java&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>I got this exception when i run this target script.</p>
  
  <pre><code>[java] java.lang.IllegalAccessException: Class org.apache.tools.ant.taskdefs.ExecuteJava can not access a member of class A with modifiers "public static"
       [java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:180)
  </code></pre>
  
  <p>This is my java program</p>
  
  <pre><code>class A
  {
      public static void main(String[] args) 
      {
          System.out.println("Hello java!");
      }
  }
  </code></pre>
  
  <p>Where im going wrong?</p>
  
  <p>thanks,
  Srinivasan R.</p>