Defining the server runtime environments preferences

Using the Preferences page, you can direct the workbench to use a specific runtime environment of an application server for compiling, testing, or running your application.

Procedure

  1. From the Window menu, select Preferences.
  2. In the Preferences window, expand the Server folder and then select Runtime Environments.
    The Server Runtime Environments section of the Preferences dialog is displayed.
  3. Optional: Click Search to search your local directory for server runtime environments. Searching on a remote host is not supported.
    1. The Search for Runtime Environments dialog box opens. In the Folder field, browse or type the directory where you would like the workbench to start searching for server runtime environments. Click OK.
    2. If a list of installations is displayed, select the target server and click OK. If no installations of any application servers are found, continue completing the steps for this task.
  4. Click Add.
    The New Server Runtime Environments wizard opens.
    1. Under the Select the type of runtime environment list, select a server and version level as the target server runtime environment.
      Tip: In the Select the type of runtime environment label, you can replace the text type filter text with keywords to filter the list of available application servers. The following examples are filter keywords:
      Apache
      Filters the list of available servers where the vendor is Apache.
      WebSphere
      Filters the list of available servers where the name is WebSphere®.
      ejb
      Filters the list of available servers that support ejb modules.
      web
      Filters the list of available servers that support web modules.
      5.0
      Filters the list of available servers that are at version, 5.0 or supports Java™ Platform, Enterprise Edition 5 specification level.
      1.2
      Filters the list of available servers that supports Java EE 1.2 specification level or any servers that might have a version-level of 1.2.
    2. When you add a server runtime environment, by default a server is created and added as an entry in the Servers view. If you want to add the server runtime environment and not create the server in the Servers view, clear the Create a new local server check box.
    3. Click Next. A panel for the server is displayed.
    4. For Installation directory or Location field, type or browse to the location of the target server.
      Tip: If you specify a false location for the target server, use the workbench to assemble modules and then use the application server to deploy the modules.
      If you selected the target server as J2EE Runtime Library (a generic Java EE container), specify a directory that contains .jar files such a \bin\lib directory for a Java developer kit (JDK) installation.
    5. Click Finish.
      The target server name and type variables are added to the table in the Server Runtime Environment section.
    6. In the Preferences dialog, click OK.

What to do next

Important: When you use Rational Application Developer, if you change the target server for an EJB project at 2.1 specification-level or earlier, regenerate the deployment code by right-clicking the EJB project, and selecting Java EE Tools > Prepare for deployment. If you attempt to run an application on a server target that is different from its generated deployment code, the application fails to run.

When you deploy Java EE applications in WebSphere Developer Tools, you do not need to select Prepare for deployment before you deploy or run any Java EE applications on WebSphere Application Server traditional or Liberty.