title: Command line load-time weaving
body: <p>So I am starting with AspectJ and have a problem. The following example works perfectly in Eclipse but when I try to run it in bash - it does not work. </p>
  
  <p>This is my code I will monitor:</p>
  
  <pre><code>public class TestClass {
    public static void method1() {
      System.out.println("Hello World!");
    }
  
    public static void main(String[] args) {
      method1();
    }
  }
  </code></pre>
  
  <p>This is my Aspect class:</p>
  
  <pre><code>import org.aspectj.lang.annotation.After;
  import org.aspectj.lang.annotation.Aspect;
  import org.aspectj.lang.annotation.Pointcut;
  
      @Aspect
      public class LogMe {
          @Pointcut("call(public* TestClass.*())")
          public void metCall() {}
  
          @After("metCall()")
          public void aftercallAdvice() {
              System.out.println("Blah");
          }
      }
  </code></pre>
  
  <p>What I do is create jar called 'apsects.jar' with <code>META-INF/aop-ajc.xml</code> with</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;aspectj&gt;
          &lt;aspects&gt;
                  &lt;aspect name="LogMe"/&gt;
          &lt;/aspects&gt;
          &lt;weaver options="-showWeaveInfo"/&gt;
  &lt;/aspectj&gt;
  </code></pre>
  
  <p>I try to run it like that:</p>
  
  <p><code>java -javaagent:/home/tdi/dev/test/aspectjweaver.jar -classpath "aspects.jar;/home/tdi/dev/test/aspectjrt.jar" TestClass</code></p>
  
  <p>What I get is:</p>
  
  <p><code>Error: Could not find or load main class TestClass</code></p>
  
  <p>How can I run this application with LTW aspects ? </p>