This topic describes common tasks you can perform with enterprise applications. For
more detailed information, click the links in the right column.
To perform this task |
Follow these steps |
Create a project. |
- Choose File > New Project (Ctrl-Shift-N).
- Select the correct template for your project.
|
Add a JAR file to a project's classpath. |
- In the Projects window, right-click the project's Libraries node and
choose Add JAR.
- Select the JAR file in the file chooser.
If you also want to attach source code and Javadoc for the JAR file,
use the Add
Library command instead.
|
Set up compilation dependencies between projects. |
- In the Projects window, right-click the project's Libraries node and
choose Add Project.
- Select the project folder for the project that you want to add to the project's classpath.
|
Add a module to an enterprise application. |
- Open the module project and the enterprise application project.
- In the Projects window, right-click the enterprise application node for
the Java EE application and choose Add
Java EE Module.
- In the dialog box, select the module and click OK.
|
Build a project. |
- Make sure that your resources are on the classpath.
- Choose Run > Build
Main Project (F11) from the main menu or right-click any project node and choose Build.
|
Clean a project. |
- Right-click the project node and choose Clean.
|
Deploy a project. |
- Right-click the project node and choose Deploy.
All sub-projects are compiled.
If the application has already been deployed to the server, it is undeployed.
The EAR project's deployment directory is cleared (all the content is deleted).
The files in the build directories for each of the sub-projects are then copied
into the EAR deployment directory, and the directory is used to redeploy the
application to the server.
|
Run a project. |
- Choose Run > Run
Main Project (F6) or right-click any project node and choose Run.
All sub-projects of the EAR are compiled. New and changed files are copied
from sub-projects' build directories to the EAR's deployment directory, and
the directory is used to redeploy the application. The "client" for
the EAR is then triggered (e.g., a web application opens in the browser).
|
Modify deployment settings. |
Do one or both of the following:
|
Verify an enterprise application. |
- Right-click any module project whose target server is the Sun Java
System Application Server/Glassfish and choose Verify.
The Verifier window opens and displays all the results.
- Filter the results according to your needs:
- Click Failures Only to display only failures.
- Click Failures and Warnings Only to display only failures and warnings.
- Make appropriate changes, if any, and verify the project again.
|
Debug a project. |
- Choose Debug > Debug
Main Project (Ctrl-F5) or right-click any project and choose Debug.
|
Attach source code to libraries for debugging. |
Instead of debugging the source code of a library that you created in the IDE,
debug the project where you created the library.
But, if you want to debug a library created outside the IDE, do the following:
- Choose Tools > Libraries from the main menu.
- If the JAR file is not already registered in the Library Manager,
create a new library using the Add Library button.
- Select the library in the left panel of the Library Manager.
- In the Classpath tab, click Add JAR/Folder and specify the location
of the JAR file containing the compiled class files. A library can contain
multiple JAR files.
- In the Sources tab, add the
folder or archive file containing the source code.
|
Add Javadoc to a project. |
- Choose Tools > Libraries from the main menu.
- If the JAR file is not already registered in the Library Manager,
register the JAR file as described above.
- In the Javadoc tab, click
Add ZIP/Folder and specify the location of the Javadoc files.
|
Repackage an existing EAR file for deployment on a different application server. |
- Create a Packaged Archive project
based on the existing EAR file.
- In the new project, modify the appropriate configuration files and create
any necessary server-specific files.
|
Set the main project. |
- Right-click the project node and choose Set as Main Project.
|