Community
Participate
Working Groups
LTW doesn't work using JRE1.4 in Eclipse now I want to support JRE1.4 when LTW. I defined a aop.xml file in application META-INF path, it works fine using JRE1.4 in command-line, aop.xml file is used when LTW, the command as below: "D:\work\BTM\eclipse 3.1.1\eclipse-SDK-3.1.1-win32\eclipse-1.4.2\jre\bin\java" -classpath "C:\aspectj1.5\lib\aspectjweaver.jar" "-Djava.system.class.loader=org.aspectj.weaver.loadtime.WeavingURLClassLoader" "-Daj.class.path=D:\work\BTM\eclipse 3.1.1\jre1.4.2\myTest;C:\aspectj1.5\doc\examples\armtest\jar\btm-deps-e3.1.jar;C:\aspectj1.5\doc\examples\armtest\jar\btm-rt.jar" Hello but it doesn't work in Eclipse, I added upper command to VM arguments, it can't find aop.xml, because if I changed aop.xml to be wrong, there is no any error when execute the application in Eclipse , but there will be error when execute it in command-line, based on this point, I think that aop.xml didn't be used in Eclipse, I also tried to add "-Daj.aspect.path=D:\work\BTM\eclipse 3.1.1\jre1.4.2\myTest", but it is still. so I want to confirm if AspectJ only supports command-line for JRE1.4? doesn't support Eclipse for JRE1.4? BTW, my Eclipse env: eclipse 3.1.1 + ajdt_1.3_for_eclipse_3.1 + Sun JDK 1.4.2. I also tried to use eclipse 3.1.2, but this problem is still existed.
Created attachment 35059 [details] my test application the attached file Test.jar(only 3KB) is my test application, which includes four files: Hello.java, World.aj, run.bat and aop.xml in META-INF, Hello.java only prints "Hello", and World.aj and aop.xml will print "World". if I execute run.bat, there will print "Hello" and "World". but I run the class Hello in Eclipse, there is only print "Hello". snapshot.doc is my executed result in my env, you can refer to it.
Created attachment 35060 [details] executed result snapshot
I think you just need to adjust your launch configuration slightly. Could you try this one that I'm about to attach? Put it in your project and then right click > Run As > Run.. and select "Hello".
Created attachment 35067 [details] Launch configuration
Based on you attached file , I fixed this problem, the cause is to must add aspectjweaver.jar to User Entries even if already added it to Java Build Path, and remove current project in User Entries in run Classpath tab, Thanks for you helps