Reputation: 569
I have access to a project which is deployed in WebSphere. I only create .class
files and put them under WEB-INF.
Now, one of my Java class requires a JAR. I don't have access to add a JAR and re-deploy. Only I need to add the JAR which is in C drive of the same machine to the class path of the project; so that it can load the JAR while loading.
How can I do this?
Upvotes: 4
Views: 5711
Reputation: 17896
If you don't want to place it in WEB-INF/lib during your build, you can configure it as a "shared library" in the administration console then associate it with one or more applications.
Since this is a GUI, I won't bother going into the details. From the toplevel of the administration console, there is an Environment > "Shared libraries" page that's basically for this exclusive purpose.
<library id="someLibrary">
<!-- All the jar files in ther servers lib folder -->
<fileset dir="${server.config.dir}/lib" includes="*.jar" scanInterval="5s" />
</library>
<application location ="webStore.war">
<classloader commonLibraryRef="someLibrary" />
</application>
Upvotes: 5