You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README-AspectJ.adoc 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. = AspectJ^TM^
  2. _Version @build.version.long@ released on @build.date@._
  3. == 1 Contents of this Package
  4. * the link:bin[`<aspectj install dir>/bin`] directory has scripts for
  5. ** `ajc`: the compiler for the AspectJ language
  6. * the directory link:lib[`<aspectj install dir>/lib`] has the AspectJ
  7. binaries,
  8. ** `aspectjtools.jar`: libraries for `ajc` and the Ant tasks
  9. ** `aspectjrt.jar`: runtime library for AspectJ programs
  10. * the directory link:doc[`<aspectj install dir>/doc`] has examples,
  11. programming and development environment guides, instructions for the Ant
  12. tasks, a README for 1.1 changes, and a quick reference, all linked from
  13. the link:doc/index.html[index] page.
  14. * this README-AspectJ.adoc, and
  15. * the LICENSE-AspectJ.adoc applying to this distribution.
  16. '''''
  17. == 2 Install Procedure
  18. The AspectJ tool `ajc` is a Java program that can be
  19. run indirectly from the scripts or directly from `aspectjtools.jar`. The
  20. `aspectjrt.jar` needs to be on the classpath when compiling or running
  21. programs compiled by `ajc`. This procedure shows ways to do that.
  22. After finishing automatic installation, we recommend that the following
  23. steps to complete your installation:
  24. *2.1 Add `<aspectj install dir>/lib/aspectjrt.jar` to your class path*
  25. ____
  26. This small .jar file contains classes required to compile programs with
  27. the ajc compiler, and to run programs compiled with the ajc compiler.
  28. You must have these classes somewhere on your class path when running
  29. programs compiled with ajc. For detailed instructions please see the
  30. xref:#configInstructions[Configuration Instructions] at the bottom of
  31. this document.
  32. ____
  33. *2.2 Put the AspectJ `bin` directory on your PATH*
  34. ____
  35. Modify your PATH to include `<aspectj install dir>/bin`. This will
  36. make it easier to run ajc. For detailed instructions please see the
  37. xref:#configInstructions[Configuration Instructions] at the bottom of
  38. this document.
  39. ____
  40. *2.3 Review the documentation and examples*
  41. ____
  42. Development and programming guides are available in
  43. link:doc/index.html[docs], and example programs and an Ant script are
  44. available in link:doc/examples/[examples].
  45. ____
  46. If you did not use the automatic installation process, you may wish to
  47. create short launch scripts to start ajc easily (section 3).
  48. '''''
  49. == 3. Running the Tools
  50. If you did not use the automatic installation process or the default
  51. launch scripts do not work on your system, you may wish to create short
  52. launch scripts to start ajc easily.
  53. You can also run the `aspectjtools.jar` directly using java's -jar
  54. option:
  55. ____
  56. `C:\jdk1.3\bin\java.exe -jar D:\aspectj\lib\aspectjtools.jar %*`
  57. ____
  58. This will run `ajc`, the AspectJ compiler.
  59. You can also create scripts like those created by the installer. These
  60. scripts use full paths that are system dependent so you will likely have
  61. to change these.
  62. Here's a sample launch script for WinNT and Win2K (note that this is
  63. single line in the .bat file):
  64. ____
  65. `C:\jdk1.3\bin\java.exe -classpath D:\aspectj\lib\aspectjtools.jar -Xmx64M org.aspectj.tools.ajc.Main %*`
  66. ____
  67. Here's a sample launch script for a Unix shell (on Linux using Sun's
  68. JDK1.3):
  69. ____
  70. `/usr/java/jdk1.3/jre/bin/java -classpath /home/aspectj/lib/aspectjtools.jar -Xmx64M org.aspectj.tools.ajc.Main "$@"`
  71. ____
  72. '''''
  73. [[configInstructions]]
  74. == 4. Configuration Instructions
  75. === 4.1 Adding `<aspectj install dir>/lib/aspectjrt.jar` to your classpath
  76. There are several ways to add this jar file to your classpath:
  77. * copy `aspectjrt.jar` to the `jdk/jre/lib/ext` directory
  78. * add `aspectjrt.jar` to your CLASSPATH environment variable (see the
  79. next section for details)
  80. * always use the "`-classpath aspectjrt.jar`" option when running
  81. programs compiled with ajc
  82. === 4.2 [#6.1]#Setting the Environment Variables on Windows#
  83. The following instructions use the PATH variable as an example, but this
  84. process is identical for the CLASSPATH variable.
  85. You can do the variables permanently for all the shells that you will
  86. run or temporarily only for the current shell. To change the PATH only
  87. in the current shell, and assuming you've installed AspectJ in
  88. `C:\apps\aspectj`, type:
  89. ____
  90. `> set PATH=%PATH%;C:\apps\aspectj\bin`
  91. ____
  92. *Changing Environment Variables Permanently on WinNT and Win2000*
  93. * open the Environment Variables dialog
  94. ** WinNT: in "Control Panels" double-click "System" and select the
  95. "Environment" tab
  96. ** Win2K: in "Control Panels" double-click "System", select the
  97. "Advanced" tab and click the "Environment Variables..." button
  98. * select the environment variable for editing, or add it using the
  99. "New..." button if it does not exist
  100. * add the new entry separated from the others by a semi-colon (;) and
  101. close the dialog
  102. * note that the change will not affect shells that were already running
  103. *Changing Environment Variables Permanently on Win9x*
  104. * open the AUTOEXEC.BAT with an editor such as NotePad
  105. * edit the PATH statement to include the new entry and save the file,
  106. e.g. +
  107. +
  108. ____
  109. `PATH C:\WINDOWS;C:\WINDOWS\COMMAND;C:\;C:\DOS;C:\apps\aspectj\bin`
  110. ____
  111. * note that the change will not affect shells that were already running