NEW: a plugin combining
ArchJava and AcmeStudio is now
available. Download AcmeArchJavaIDE.zip,
unzip it into the eclipse directory and say "yes" when it asks about replacing
a config.ini file (this file is necessary for Acme's configuration; you might
want to use a fresh version of Eclipse if you don't want your existing
Eclipse installation to use
Acme's "branding"). You need to use Eclipse 3.0.0 or later, including the
JDT. Follow the directions below to use the ArchJava part of the plugin;
directions for using AcmeStudio are also
available.
Important Note: While the ArchJava IDE is covered by the GPL, the AcmeStudio is covered by a separate license; by downloading AcmeStudio you are agreeing to this license.
Shortly, we'll have a tutorial for using the code generation facilities of this new integrated environment up on the website.
We have developed a plugin for the Eclipse platform that implements an integrated development environment for ArchJava.
See the Eclipse documentation for how to take advantage of the Eclipse environment. The ArchJava IDE is similar to the JDT, Eclipse's build-in Java environment. However, the ArchJava IDE is still a prototype, and does not support all of the features of the JDT.
To get started with the ArchJava plugin, run Eclipse and create a new ArchJava project by choosing File | New | Project... and clicking first on ArchJava in the left pane then ArchJava Project in the right pane. Click Next, specify the name of the new ArchJava project, and click Finish to create the project.
Next, add an ArchJava file to the project. You can add an existing file using the File | Import menu, or you can create an empty file using File | New | File... and specifying the file name. Make a change to the file and press Ctrl-S to save it. The environment will incrementally rebuild the project, displaying any error messages in the tasks list. Clicking on an error message jumps to the location in the source file that caused the error.
In order to run your ArchJava program, choose Run... from the Run menu. Choose ArchJ Launch Configuration and click New. Enter a name for your configuration. Choose the ArchJConfigurationTab. Pick the project you want to run, and pick the main class from that project (this should be a fully qualified class name, with no .archj at the end). Choose Apply.
Due to a bug in the current IDE, next choose the Arguments tab. Uncheck the Use default working directory option, and enter the project directory instead. Click apply. Now click on Run. Your application should execute.
The current Eclipse-based ArchJava IDE is still an early prototype, and we are working on the following issues:
The original ArchJava compiler is a command-line tool similar to javac.
Write your program in one or more files with a .archj extension. Run the compiler with the command:
archj file1.archj file2.archj file3.archj ...
The compiler is a drop-in replacement for javac. It will recursively compile any referenced ArchJava source file that is not up to date.
To try out the Capitalize example from the examples directory, open a shell window (or MS-DOS prompt) and change to the ArchJava/examples directory. To compile the example, make sure the current directory "." is in your CLASSPATH, and type:
archj capitalize/Main.archj
You can then run the example by typing:
java capitalize.Main < capitalize/Main.archj
You should see the Main.archj file with alternating uppercase and lowercase characters. Note: make sure that the current directory . is in your classpath. Windows users should replace / with \ in the preceeding examples.
The ArchJava release includes an extremely simple visualization tool based on the Graphviz toolkit from AT&T research. To use it, make sure that the program 'dot' is installed and is in your path; if not, download Graphviz and install it. Also make sure that ghostview is in your path.
Then, you can visualize the architecture of any ArchJava component simply by running archview on the file (after taking off the .archj suffix). For example, to view the architecture of the Capitalize component in the architecture above, change to the examples directory and type:
archview capitalize/Capitalize
If your configuration is set up properly, a window displaying the architecture should pop up after a moment's delay. To see the architecture of the whole program (which includes Capitalize as a subcomponent) type:
archview capitalize/Main
As mentioned above, this tool is extremely primitive. We are currently extending the IDE described above to support visualization based on the AcmeStudio architecture environment.
The ArchJava compiler includes support for the AliasJava language, which allows developers to specify data sharing relationships between components in an architecture. To enable checking of alias annotations, run the compiler with the -A option, or use aliasj in place of archj. For all but the most trivial programs, the compiler will complain that files referenced in the standard library have no alias annotations. We hope to provide an annotated version of the standard library eventually, but for now, you can download the library source code from java.sun.com and annotate the relevant parts of the standard library yourself. Use the -aliasstdlib {classdir} option to direct the compiler to read the alias annotations from an annotated standard library code in the directory given. For example, to compile the pipeline architecture from the examples directory with alias annotation checking, use:
aliasj -aliasstdlib ~my_login/annotated_classes/ styles/Pipeline.archj
The examples from the OOPSLA '02 AliasJava paper can be found in examples/aliasing. To check the alias types, change to the examples directory and run:
aliasj aliasing/*.java
This release of the compiler includes an experimental release of alias annotation inference. To run inference on unannotated versions of the OOPSLA examples, change to the examples/inference directory and run:
infer -d output *.java
aliasj output/*.java
The -d option to the infer program instructs the inference engine to write the modified output files to the output directory. Other options include -R (infer annotations for all reachable source files) and -C (check the inferred annotations for correctness). There may be a few corner cases in which the inferred annotations are incorrect; we are continuing to work on the inference implementation.
Release 1.3.2 of the compiler has preliminary support for custom connectors in ArchJava. The directories examples/connector and examples/poemswap have examples of defining and using custom connectors. Note that support for custom connectors is still beta, and a couple of the examples in this directory may not work in their current form.