Summary: | the compiler does not understand jars given with -cp | ||
---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Antti Karanta <Antti.Karanta> |
Component: | Compiler | Assignee: | Adrian Colyer <adrian.colyer> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | matthew_webster |
Version: | 1.2 | ||
Target Milestone: | 1.2.1 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Antti Karanta
2004-09-16 08:13:53 EDT
I forgot to mention that the compilations work fine if I include the junit.jar in my CLASSPATH environment variable and omit the -cp/-classpath option totally. 1. The -classpath option will override the CLASSPATH environment so you need to specify all your dependencies. 2. I too have been having trouble using AspectJ 1.2 final on the command line. Try enclosing certain arguments in (") e.g. -classpath "...". Also I have been unable to reproduce the problems with the latest development level so you may want to try that. 1. I know. This is a very small sample project I used on another bug report - it doesn't depend on any other external libraries besides junit and AspectJ (I added the AspectJ jars to the -cp option, although that doesn't help w/ the error of not finding the junit classes). 2. The latest dev build seems to work fine with -classpath option. However, with the -cp option the same problems still appear. I believe the -cp should be just a shorter alias for -classpath, so the behavior should be identical . This might be something to look into. This bug may be related to bug 73433. Under that bug I fixed the problem where -cp meant something different to -classpath. However, if it is the same issue, I'm confused as to why the latest dev build is still not behaving itself. When you have tried the latest dev version, have you set everything up correctly to ensure you don't exactly run the old version? When the ajc.bat file runs, it sets the field ASPECTJ_HOME to point to your installation of aspectj. If you then later install a dev build and run c:\mydevaspectj1.2\bin\ajc.bat - then it will discover ASPECTJ_HOME is set and use the AspectJ it points to (the old version), rather than your new dev version. To definitively run with the new version you need to unset ASPECTJ_HOME. Sorry, I had missed unsetting the ASPECTJ_HOME (I had only set PATH and CLASSPATH to point to the dev version). Now that I unset that, the dev version seems to work fine. Case closed, I think. Fix released as part of AspectJ 1.2.1 |