Wiki source code of Working with the Jars in WebObjects Extensions
Version 19.1 by Lachlan Deck on 2007/09/10 18:32
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | The jar files in ##/Library/WebObjects/Extensions## are automatically added to the classpath when a WebObjects application is launched from JavaMonitor or the command line. They are also added to the classpath by Xcode. To make running an application in Eclipse more closely match these other situations, create a **User Library** to match the jar files in **/Library/WebObjects/Extensions**. | ||
2 | |||
3 | {{warning title="Recommendation"}} | ||
4 | |||
5 | Relying on the one version of jars in {{/Library/WebObjects/Extensions}} leads to problems when managing multiple applications. i.e., if you update the jars or remove any of them you are required to update potentially every application. It is therefore highly recommended that you avoid keeping and using jars in {{/Library/WebObjects/Extensions}} and instead keep them in your project itself or in a framework that can be embedded in your application. See [Add a Framework Dependency] and [Add a Jar Dependency]. | ||
6 | |||
7 | {{/warning}} | ||
8 | |||
9 | {{tip title="Hint"}} | ||
10 | |||
11 | Afterwards, you will need to then add this library to the build path of any or all relevant projects, and to the launcher for applications and unit tests. | ||
12 | |||
13 | {{/tip}} | ||
14 | |||
15 | To do this, go to Window - Preferences. No, I don't know why they put it under the Window menu. You may get an error the first time you do this. If this happens, close the Preferences window and open it again. Expand the tree on the left like this: | ||
16 | [[image:UserLibraries.jpg]] | ||
17 | |||
18 | |||
19 | \\Click **New** and enter **WebObjectsExtensions** as the library name: | ||
20 | [[image:LibraryName.jpg]] | ||
21 | |||
22 | |||
23 | \\Click **OK**, select **WebObjectsExtensions**, and click **Add Jars**. Select all the jars in **/Library/WebObjects/Extensions**. The result should look like this (you may not have this exact same set of jars but if you have followed the other instructions you should have the ones that are needed): | ||
24 | [[image:FinalLibraries.jpg]] | ||
25 | |||
26 | {{warning title="Watch for Updates"}} | ||
27 | |||
28 | This is a *static* list of jars. If anything is added to or modified in */Library/WebObjects/Extensions*, you will need to manually edit this User Library. | ||
29 | |||
30 | {{/warning}} | ||
31 | |||
32 | After that you added the library to the preferences, you need to add this library to the build path of projects that depends on the jars stored in **/Library/WebObjects/Extensions**. Right-click on the project > Build Path > Add Librairies > User Library, and select **WebObjectsExtensions**. |