blob: c60029d5d83afcbfa059512ee26fe2fface52d45 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-2.0/. Contributors: IBM Corporation - initial API and implementation" />
<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta content="task" name="DC.Type" />
<meta name="DC.Title" content="Specifying target servers for J2EE projects" />
<meta name="abstract" content="When you develop J2EE applications, you can specify the server runtime environments for your J2EE projects. The target server is specified during project creation and import, and it can be changed in the project properties. The target server setting is the default mechanism for setting the class path for J2EE projects." />
<meta name="description" content="When you develop J2EE applications, you can specify the server runtime environments for your J2EE projects. The target server is specified during project creation and import, and it can be changed in the project properties. The target server setting is the default mechanism for setting the class path for J2EE projects." />
<meta content="J2EE, target servers, projects, target servers, J2EE applications" name="DC.subject" />
<meta content="J2EE, target servers, projects, target servers, J2EE applications" name="keywords" />
<meta scheme="URI" name="DC.Relation" content="../topics/cjarch.html" />
<meta scheme="URI" name="DC.Relation" content="../../org.eclipse.wst.server.ui.doc.user/topics/twinstprf.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="tjtargetserver" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
<title>Specifying target servers for J2EE projects</title>
</head>
<body id="tjtargetserver"><a name="tjtargetserver"><!-- --></a>
<h1 class="id_title">Specifying target servers for J2EE projects</h1>
<div class="id_taskbody"><p class="id_shortdesc">When you develop J2EE applications,
you can specify the server runtime environments for your J2EE projects. The
target server is specified during project creation and import, and it can
be changed in the project properties. The target server setting is the default
mechanism for setting the class path for J2EE projects.</p>
<div class="id_context"><p class="anchor_topictop" />
<p>In
order to support different application servers that use different JDK levels
for their Java™ Runtime Environment (JRE), the workbench prompts
you for a target server setting for each J2EE project. For example, if you
want to take advantage of the features of JDK 1.4.2, your applications require
different class path entries than those that were used in previous versions
of the workbench. By prompting you to specify a target server, the workbench
enforces that proper entries are added for running on the server you choose.</p>
<p>You
can also add more than one target server for your project. In this case, the
workbench prevents you from adding any facets not supported by all of the
target servers. If you add more than one target server, choose a server that
will contribute to the project's class path as the primary server.</p>
<p>When
the project is created, the class path of the project is updated with two
class path containers. One container is the JDK container and the other is
the server container. The JDK container points to the directory that contains
the JAR files that are necessary to support the JDK version. The server container
points to the directory that contains the multiple public JAR files available
in the selected server. The project then compiles based on the required JAR
files located in these folders, and you do not need to worry about adding
additional JAR files from the server during development. When the project
is compiled, the JAR files are included in the class path. You can still add
your own JAR files to the class path.</p>
<p>The target runtime environment
is specified in the org.eclipse.wst.common.project.facet.core.xml file in
the project's .settings folder. You should not edit this file manually; instead,
use the properties window as described in this topic.</p>
<p>All J2EE project
creation and import wizards prompt you to specify the target server for the
resulting projects. The list of target servers that you can choose from is
filtered based on installed runtimes, the J2EE level of the application, and
the J2EE module type. For example, for EJB projects only application servers
that support Enterprise JavaBeans™ are displayed. All projects
inside a single EAR file must be targeted to the same server. If you create
a new project and add it to an existing EAR project during creation, the project
inherits the target server setting of the EAR project.</p>
<div class="note"><span class="notetitle">Note:</span> Utility Java projects
that are added to an application are targeted to the same target server as
the application. Web library projects that are added to a Web project are
targeted to the same target server as the Web project.</div>
<p>To modify
the target runtime and default server for an existing project, complete the
following steps:</p>
</div>
<ol class="id_steps">
<li class="stepexpand"><span>In the Project Explorer view of the Java EE perspective, right-click the enterprise
application or module project, and select <span class="uicontrol">Properties</span>.</span>
</li>
<li class="stepexpand"><span>Select the <span class="uicontrol">Targeted Runtimes</span> page in the
Properties dialog.</span></li>
<li class="stepexpand"><span>In the <span class="uicontrol">Targeted Runtimes</span> list, select the
check boxes next to each of the runtimes that you want to develop the project
for. If you don't see the runtime that you want to use, you need to add it
to the runtimes in the workbench. For more information, see <a href="../../org.eclipse.wst.server.ui.doc.user/topics/twinstprf.html">Defining the installed server runtime environments</a>.</span> <div class="note"><span class="notetitle">Note:</span> Only the
runtimes compatible with the project's facets are shown. You can select the <span class="uicontrol">Show
all runtimes</span> check box to display the runtimes not compatible
with the project's current facet configuration. These runtimes are grayed
out.</div>
</li>
<li class="stepexpand"><span>To select the primary runtime, click on a runtime and then click
the <span class="uicontrol">Make Primary</span> button.</span> If you select any
runtimes for the project, you must make one of those runtimes the primary
runtime for the project. If you select only one runtime from the list, that
runtime is automatically made the primary runtime. The primary runtime is
shown in bold text.</li>
<li class="stepexpand"><span>Click <span class="uicontrol">OK</span>.</span></li>
</ol>
<div class="id_postreq"><p class="anchor_topicbottom" />
</div>
</div>
<div><div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="../topics/cjarch.html" title="The Java 2 Platform, Enterprise Edition (J2EE) provides a standard for developing multitier, enterprise applications.">J2EE architecture</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br />
<div><a href="../../org.eclipse.wst.server.ui.doc.user/topics/twinstprf.html">Defining the installed server runtime environments</a></div>
</div>
</div>
</body>
</html>