blob: d518d7b1bacc53e772c0b62370a02963050cf0a1 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>
Launching a program with the main method in an aspect
</title>
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
</head>
<body>
<h1>
Launching a program with the main method in an aspect
</h1>
<p>
The way to launch an AspectJ program where the main method is contained
in an aspect is to use an <b>AspectJ/Java Application</b> launch
configuration.
<ol>
<li>In the Package Explorer, select the compilation unit or
.aj file you want to launch.</li>
<li>From the pop-up menu, select <b>Run &gt AspectJ/Java Application</b>.
Alternatively, select <b>Run &gt Run As &gt AspectJ/Java Application</b>
in the workbench menu bar, or select <b>Run As &gt AspectJ/Java Application</b>
in the drop-down menu on the <b>Run</b> tool bar button</li>
<li>Your program is now launched, and text output is shown in the
Console.</li>
</ol>
</p>
<p>
You can also launch an AspectJ program with the main method in an aspect, by
selecting a project instead of the compilation unit or .aj file. You will
be prompted to select the aspect from those aspects and classes that define a
main method.
</p>
<p><img border="0" width="159" height="27" src="../images/ngrelt.gif" alt="Related tasks"><br>
<a href="launching.htm">Launching a program with the main method in a class</a><br>
<a href="aspectpathlaunching.htm">Launching a program with an aspectpath or an outjar</a><br>
<a href="loadtimeweaving.htm">Load-time weaving</a><br>
<a href="debugging.htm">Debugging a program</a>
</p>
</body>
</html>