Show TOC

Building, Publishing and Removing Published Java EE ApplicationsLocate this document in the navigation structure

Use

To streamline your development process, SAP NetWeaver Developer Studio allows you to build, deploy and undeploy your Java EE applications in one step. This saves you time from having to build and to deploy your Java EE applications separately. The publish option uses the build, deployment and undeployment functionality of AS Java.

Note

If you have already built your application and you want to deploy it, you have to use another deployment option. More information: Deploying Archives

Note

You have to use the SAP NetWeaver Developer Studio if you want to deploy an SAP-specific archive. More information: Deploying and Undeploying with SAP NetWeaver Developer Studio

Prerequisites
  • A running AS Java is registered and marked as the default system in the SAP NetWeaver Developer Studio. This is done by opening Start of the navigation path Windows Next navigation step Preferences Next navigation step SAP AS Java End of the navigation path.

  • A Java EE application is created in the SAP NetWeaver Developer Studio.

  • The Project Explorer view of the SAP NetWeaver Developer Studio is open.

Procedure

Publishing Java EE Applications from the Project Explorer View

  1. In the context menu of the application in the Project Explorer view, choose Start of the navigation path Run As Next navigation step Run on Server End of the navigation path. The Run on Server dialog box appears.

  2. Define a server. You can:

    • Select an existing server

    • Manually define a new server.

      Recommendation

      If you have to use multiple systems with the same SID, you need to register them in different domains via Start of the navigation path Windows Next navigation step Preferences Next navigation step SAP AS Java End of the navigation path.

  3. Choose Next . The Add and Remove Projects page of the Run on Server wizard appears with the application already moved to the Configured Projects list.

  4. Choose Finish . The application is published and opened in a browser with automatically generated URL.

Publishing Java EE Applications from the Servers View

  1. In the context menu of the server in the Servers view, choose Add and Remove Projects .

  2. From the Available projects list select the projects you want to publish.

  3. Choose Add or Add All .

  4. Choose Finish .

Removing Published Applications

To remove applications from the server where they reside:

  1. In the context menu of the server in the Servers view, choose Add and Remove Projects .

  2. Select the project in the Configured Projects list.

  3. Choose Remove .

Building Java EE Archives

If you need to only build an archive of your Java EE application without publishing it, you can create an export of your project.

  1. In the context menu of the application in the Project Explorer view, choose Start of the navigation path Export Next navigation step SAP xxx file End of the navigation path .

  2. In the Export wizard, specify the name and destination of the Java EE archive file and choose Finish .

All the libraries from the classpath of your Web/EJB/application client/connector project will be packaged in the created Java EE archive. For a Web project, they are packaged in the WEB-INF/lib of the WAR, and for the other projects - in the root of the EAR.

If you do not need to package a library from your classpath dependencies in the WAR/EAR archive, before performing the above described export, refer the library via the SAP_USER_ADD_LIBS classpath variable instead of referring it directly in the classpath of your project.

  1. Open the project context menu and choose Start of the navigation path Properties Next navigation step Java Build Path End of the navigation path .

  2. Choose the Libraries tab. It contains a list of all libraries in the project.

  3. Choose Add variable . In the New Variable Classpath Entry window, select SAP_USER_ADD_LIBS .

  4. Choose Configure variable .

  5. In the Preferences dialog, choose Edit and specify the file name and location.

  6. In the project context menu, choose Start of the navigation path Export  Next navigation step SAP xxx file End of the navigation path .

As a result, the created archive will not contain the JAR file of the selected library.