Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Important aspects of JDK 1.4 weaving

 
> Well, I have been using aj.bat, but its one I've had to scrap together from different places, since the distributions
> here: http://www.eclipse.org/aspectj/downloads.php don't appear to have a "bin" directory. 
 
I get the correct directories, including bin:
 
$ j4 -jar ../../../downloads/toDelete/aspectj-1.5.1_a.jar -to aspectj-1.5/
$ aspectj-1.5/bin/ajc -version
AspectJ Compiler 1.5.1a built on Monday Apr 10, 2006 at 10:52:04 GMT
 
Wes
 
------------Original Message------------
From: bo.zimmerman@xxxxxxxxxxxxxxxxxxxxx
To: aspectj-users@xxxxxxxxxxx
Date: Wed, Apr-26-2006 9:15 AM
Subject: Re: [aspectj-users] Important aspects of JDK 1.4 weaving
Hi Mathew,
 
Thank you so much for your reply.  First off, I'm ecstatic that you got it working.  That means my woes are almost a forgotten memory.  I only wish I could reproduce your success.  However, you are correct when you suggest I should have included more detail in my question.  The devil's in the details, and apparantly in the environmental details, eh? 
 
Well, I have been using aj.bat, but its one I've had to scrap together from different places, since the distributions here: http://www.eclipse.org/aspectj/downloads.php don't appear to have a "bin" directory.  Here are my calls and other environment information:
 
 Directory of C:\dev\libs\aspectj-1.5.1_a\test\aspects
04/26/2006  11:10 AM    <DIR>          .
04/26/2006  11:10 AM    <DIR>          ..
04/26/2006  10:48 AM               769 aj.bat
04/26/2006  10:46 AM             2,947 HelloAspect.class
04/24/2006  04:17 PM               229 HelloAspect.java
04/26/2006  10:46 AM               503 HelloWorld.class
04/24/2006  04:08 PM               214 HelloWorld.java
04/25/2006  12:26 PM    <DIR>&n bsp;         META-INF
               5 File(s)          4,662 bytes
               3 Dir(s)  55,960,535,040 bytes free
 
C:\dev\libs\aspectj-1.5.1_a\test\aspects>set ASPECTPATH
ASPECTPATH=c:\dev\libs\aspectj-1.5.1_a\test\aspects
 
C:\dev\libs\aspectj-1.5.1_a\test\aspects>aj HelloWorld
 
C:\dev\libs\aspectj-1.5.1_a\test\aspects>"C:\j2sdk1.4.2_02\jre\bin\java" -classp
ath ".;c:\dev\libs\aspectj-1.5.1_a\test\aspects;c:\dev\libs\aspectj-1.5.1_a\lib\
aspectjtools.jar" "-Djava.system.class.loader=org.aspectj.weaver.loadtime.Weavin
gURLClassLoader" "-Daj.class.path=c:\dev\libs\aspectj-1.5.1_a\test\aspects;" "-D
aj.aspect.path=c:\dev\libs\aspectj-1.5.1_a\test\aspects" HelloWorld
Hello World.

The META-INF directory above does contain the same aop.xml I posted in my last message.  If you could be so kind as to remove the "echo off" from your own aj.bat and echo your execution string to me, perhaps we can determine what I've done differently/wrong?  Are my paths set up incorrectly?  Perhaps I'm using the wrong library?
 
Thanks!
 
- Bo
 
Bo,

How are you invoking your application to use LTW? According to the AspectJ Development Environment Guide http://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html your aop.xml should be in a "META-INF" directory, typically used for configuration information when packaging your application as a JAR. Then you can us "aj" (instead of "java") to run your application:

C:\temp\bo.zimmerman>c:\aspectj1.5\bin\aj HelloWorld
info AspectJ Weaver Version 1.5.0 built on Tuesday Dec 20, 2005 at 12:05:54 GMT
info register classloader org.aspectj.weaver.loadtime.WeavingURLClassLoader
info using /C:/temp/bo.zimmerman/META-INF/aop.xml
info register aspect HelloAspect
info weaving 'HelloWorld'
info weaving 'HelloAspect'
info processing reweavable type HelloAspect: C:\temp\bo.zimmerman\HelloAspect.java
Before Hello World.
Hello World.

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (e xternal) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx

http://w3.hursley.ibm.com/~websterm/
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Back to the top