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.

ajdejbuilder.adoc 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. r
  2. AspectJ Development Environment (AJDE) support for JBuilder
  3. OpenTool extension Borland's
  4. JBuilder IDE
  5. .
  6. == Overview
  7. For release-specific documentation refer to the
  8. http://aspectj.org/doc/dist/changes.html[changes file].
  9. AJDE for JBuilder will allow you to:
  10. * compile AspectJ and Java files within the IDE
  11. * browse the structure of your AspectJ program
  12. * set up a compile configuration that determine which files will be
  13. passed to the compiler
  14. == Installation and Project Setup
  15. `Install procedure:` use the installer to place the
  16. "ajdeForJBuilder.jar" and "aspectjrt.jar" into JBuilder's lib/ext
  17. directory. This will also install the two html files
  18. "LICENCE-AJDEJBUILDER.html" and "README-AJDEJBUILDER.html".
  19. `Uninstall procedure:` remove "ajdeForJBuilder.jar" and "aspectjrt.jar"
  20. (and the two html files, if you like) from the "lib/ext" directory.
  21. `Project setup:` follow the normal procedure for JBuilder project setup
  22. (for an example of this please refer to the example below). However,
  23. note that all of the source files to be passed to the compiler must be
  24. added to your project either as files or within a package that is added
  25. to the project. This is necessary because -- unlike a pure Java compiler
  26. -- ajc does not search the SOURCEPATH for classes.
  27. `Starting and stopping AJDE:` select "Start AJDE" in the "AspectJ"
  28. section of the "Tools" menu, or just click on the "AJDE"
  29. (image:startAjde.gif[image]) button (label 1 in the first screenshot).
  30. This will enable AJDE commands and will replace JBuilder's structure
  31. view with the AspectJ Browser. To disable AJDE select "Stop AJDE" in the
  32. same menu, or click the "AJDE" button again.
  33. == Compiling and Running the Project
  34. To compile the project select "Build project with ajc" from the AspectJ
  35. toolbar, or click <ctrl>F11 while the editor pane is active. All of the
  36. files contained in your project and within any packages and subpackages
  37. that have been added to your project will be compiled. You may also
  38. select a different configuration (as with label 2 in the first
  39. screenshot). Then, structure of the currently visited file is shown (see
  40. label 3 in the first scrrenshot). If there is a compile error, the
  41. clickable error message is available (as with label 4 in the first
  42. screenshot).
  43. To run the project select "Run Project" from the AspectJ toolbar, or
  44. click <ctrl>F12 while the editor pane is active. Note that the "AspectJ
  45. Runtime" library must be added to your project in order to run. If the
  46. library is not added you will see a "java.lang.NoClassDefFoundError:
  47. org/aspectj/lang/Signature" error. The library is created automatically
  48. for you from the runtime in "jbuilderdir/lib/ext". You can also create a
  49. new library to use the runtime from a different location. If you have
  50. not added the library to the "Required Libraries" of your project it
  51. will be added automatically when you restart JBuilder.
  52. JBuilder7 users please note: when you set up a run/debug configuration
  53. you must select the "Build Target" (at the bottom of the "Runtime
  54. Properties" dialog) to be "<None>". This will ensure that the Java
  55. compiler is not invoked on your AspectJ sources before running or
  56. debugging the project.
  57. == Navigating the Program Structure
  58. Navigation of program structure is provided by the xref:ajbrowser.adoc#ajbrowser[AspectJ Browser],
  59. so apart from a JBuilder look and feel, the extra navigation AspectJ
  60. allows work as described there. In particular, you can use views with
  61. labels 1, 2 and 4 of the second screenshot to navigate structure using
  62. the blue links, and you can set filtering and navigate history using the
  63. toolbar shown by label 3 of the second screenshot.
  64. == Manipulating Build Configurations
  65. Build configurations can be manipulated adding, removing, and editing
  66. build configuration files. The xref:ajbrowser.adoc#ajbrowser[AspectJ Browser] is used to select
  67. the current build configuration. Configurations are represented by
  68. ".lst" files which are described in the xref:ajc.adoc[`ajc`, the AspectJ compiler/weaver] documentation.
  69. === Adding and Removing Build Configurations
  70. By default all of the files contained in your project and within any
  71. packages and subpackages that have been added to your project will be
  72. compiled. In order to compile a different configuration first add it to
  73. the project (by selecting "Add Files / Packages..." in the "Project"
  74. menu, and selecting the desired build configuration file (see label 1 in
  75. the third screenshot).
  76. === Editing Build Configurations
  77. Double click a build configuration file in JBuilder's "Project Pane" in
  78. order to edit it. Configurations can be edited as either text or in the
  79. graphical designer (see labels 2 and 3 in the third screenshot)
  80. == Example: Setting up the "Spacewar" Sample Project
  81. To set up the Spacewar example first download it the
  82. http://aspectj.org/dl[examples distribution]. Then
  83. [arabic]
  84. . launch JBuilder
  85. . in the "File" menu select "New project"
  86. . Select the location of the "aspectj/examples" directory for the
  87. project. This is because the Spacewar example uses both the "spacewar"
  88. and "coordination" packages, so we set up the project where it can get
  89. at both packages.
  90. . Choose a "jpr" project, either by typing in "Spacewar.jpr" as the
  91. project name, or by typing "Spacewar" as the project name and "jpr" as
  92. the type. Make sure "aspectj/examples" is still the directory for the
  93. project.
  94. . click "Finish"
  95. . in the "Project" menu select "Project properties..."
  96. . set the "Output path" entry to be the directory where you want your
  97. classes to go
  98. . set the "Output path" entry to be the directory where you want your
  99. classes to go
  100. . add "aspectjrt.jar" as a required library for the project. This
  101. library is located in "<jbuilder-install-directory>/lib/ext".
  102. . in the "Source" tab select the entry and click "Edit" (by default
  103. JBuilder will set this directory to be "examples/src" which does not
  104. exist)
  105. . Select the "examples" directory for the Souce.
  106. . click "OK" to close the "Project Properties"dialog
  107. . in the leftmost pane you will notice "Spacewar.jpr", right click this
  108. and select "Add to project" in the popup, then "Add class/package..." in
  109. thenext popup. Or directly choose "Add files/packages".
  110. . <ctrl> select the "spacewar" and "coordination" packages and then
  111. click "OK"; this will add the two packages to your project
  112. . click the "Build Project" button (image:jbuilder-build.gif[image]) to
  113. compile the project
  114. . open the Structure View to browse the structure of the program
  115. . click the "Run Project" button to play Spacewar (make sure that you
  116. have set up the runtime library as described above)
  117. . if you have not selected a class to run, you will be prompted to do
  118. so: select the class "spacewar.Game".
  119. . AspectJ related build options can be manipulated in the "AJDE
  120. settings" window