Java Reference
In-Depth Information
What is a library?
A
library
is an archive of compiled code that your modules depend on. Such an
archive is typically represented as a
JAR
file or an expanded
JAR
in a directory.
Libraries may optionally contain references to source files and
API
documenta-
tion: Including these references doesn't alter the usage of the library in any way,
but it does add valuable information to the editor during class navigation and
inspection. Examples of libraries include a
DBMS
vendor's private
JDBC
driver, or
an open-source
XML
parser.
4.1.2
Selecting different types of modules
IDEA
provides four distinct types of modules, which fall into two categories: basic
Java modules and enterprise Java (or
J2EE
) modules. This chapter covers the first
category; we'll reserve discussion of
J2EE
modules until chapter 11. As a head
start, here's the purpose of each of the available module types shipped with
IDEA
:
With version 5.0, this list has been expanded. Now there are six types of modules,
roughly categorized into basic/standard Java (
J2SE
) modules,
J2EE
modules, and
J2ME
modules.
Java modules
are the simplest module type and represent a basic Java appli-
cation project, whether it's a command-line tool, a Swing application, or a
JAR
library. When configuring this type of module, you can specify a set of
Java source paths that will be compiled to a single class folder. We'll discuss
using and configuring this type of module in detail in this chapter. The
basic capabilities of this module are carried over into the web module.
■
The
web module
is an extension of the Java module that adds support for
web applications. In addition to providing the ability to create and build
Java sources, it lets you edit your web application's deployment descriptor,
build and deploy it to your application server, and configure other web
application capabilities. You create a web module for each web application
in your project. Web modules will be discussed in detail in chapter 11.
■
An
EJB
module
lets you design and package a collection of Enterprise Java-
Beans.
EJB
modules will be discussed more fully in chapter 11.
■
A
J2EE
application module
is different than the other module types discussed
so far. The
J2EE
module type is primarily concerned with packaging
J2EE
applications for deployment as enterprise archive (
EAR
) files. As such, it
references Web and
EJB
modules that it packages for deployment.
■