Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] using javac

hi,

i have some really strange problem when using the javac compiler
whth a ajc compiler created jar file.

say i have the following classes aspects

<code>
public class DefaultFoo{}
public interface IFoo{public void bar();}

public aspect FooImpl
{
    public void Foo.bar(){}
}

public aspect FooWeaver
{
    declare parents: DefaultFoo implements Foo;
}
</code>

i compile all of this into a jar file (foo.jar).
when i call now "javap -classpath foo.jar DefaultFoo"
the following line will be printed
...
public void bar()
...

so i should at least safely assume the jar contains the class
with the woven implementation of bar (or shouldnt i?).


now the interessting part happens...
if i use the following java class
<code>
import DefaultFoo;

public class DefaultFooUser
{
    public static void main(String[] _args)
    {
        DefaultFoo df = new DefaultFoo();
        df.bar();
    }
}
</code>

if i compile this with the ordinary javac i will get an compiler error
on the statement "df.foo()" (can resolve method foo on ...). if i compile with ajc everthing will work fine. i must admit i am completely
stumped as i thought i could use any jar file produced by aspectj and
use it in a more standard environment.

any help

is greatly appriciated.

ciao robertj
ps: i am using aspectj 1.1.1
and jdk 1.4.2_3

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Back to the top