Entering content frame

Process documentation Referencing Libraries in Applications Locate the document in its SAP Library structure

 

In the simplest case, your application project will itself contain one or more JARs. However, you will usually want to reference external JARs in your application project. To do so, you must add the required JARs to the Java build path of your project in the Developer Studio. There are two different cases:

1. The library to be referenced is registered as an additional library on the J2EE engine. This means that the JAR is not entered in the class path of the J2EE engine. In the Developer Studio, the additional libraries are entered in a list. You can display this list using the function Add/Remove Additional Library.

2. The relevant library is implicitly entered in the class path of the J2EE engine. This also means that the library is not registered as an additional library on the J2EE engine. If you call the function Add/Remove Additional Library in the Developer Studio, you will find no entry for this library..

Example

This graphic is explained in the accompanying text

 

Depending on whether or not a JAR is an additional library, you have to proceed differently to add the JAR to the class path of the application project.

Case 1: Setting an Explicit Reference to an Additional Library

Adding the Additional Library to the EJB or Web Project

...

       1.      Select the relevant project in the J2EE Explorer.

       2.      Open the context menu and choose Add/Remove Additional Library...

       3.      In the list that appears, select the relevant library and confirm by choosing OK.

Entering the Reference to the Library in the EAR Project

       4.      Select the relevant EAR project in the J2EE Explorer.

       5.      Double-click application-j2ee-engine.xml.

       6.      On the General tab, choose the entry References.

       7.      Choose the Add button.

       8.      Then choose the button Select library/interface/service to add the reference.

       9.      Select the relevant library, as in step 3.

 

Case 2: Setting an Implicit Reference

If the library you want to reference in your application project is not entered as an additional library, proceed as follows:

...

       1.      Select the relevant project (EJB project or Web project) in the Developer Studio.

       2.      Open the context menu and choose Properties.

       3.      Choose Java Build Path (in the left pane), then choose the Libraries tab (in the right pane).

       4.      Choose Add Variable...

       5.      Select the variable SAP_SYSTEM_ADD_LIBS and then choose Extend... to select the variable extension.

       6.      Expand the appropriate node, select the relevant JAR file, and choose OK to confirm.

This graphic is explained in the accompanying text

       7.      Choose OK to confirm again in the properties window for the Java build path.

This graphic is explained in the accompanying text

In special cases, it is possible that the library to be referenced is neither registered as an additional library on the engine nor entered in its class path. This situation can arise if you create a reference to a library in a new library project. This library was therefore not installed together with the engine, but will be deployed on it at a later stage. For more information, refer to Adding JARs and References. To reference such libraries in the application project, proceed as described for case 2 (Setting an Implicit Reference).

 

 

Leaving content frame