Current location - Health Preservation Learning Network - Slimming men and women - Many jar packages in eclipse can lead to large projects. How to deal with them?
Many jar packages in eclipse can lead to large projects. How to deal with them?
1. Create a jar as a Java user library and put it in a directory on your local disk. Then add Library > to the project. User library type. The disadvantage of this method is that jar files cannot be used in the project team. Everyone has to copy a point by hand.

2. Create a jar project as a single simple project, which is not from java, then refer to the jar of this relative path in your project, add jar in the java construction path, find the relative path in the workspace, and then submit this project to CVS, so that everyone can use it as a relative path. In the future, only the project that needs to send jar for the first time will be packaged, and other publications only need to export the project itself.

If your project is an ear, add a third-party jar to the server's extended jar library directory. For example, websphere and weblogic add -Dws.ext.dirs=jarFolder on the command line (you don't need to write jar name, just write directory), or you can create a shared library on websphere and choose to enable the reference of this shared library when deploying EAR in the future.

However, it is not recommended to put jar in the lib directory of the server, because this will affect all projects, and when multiple projects use different versions of the library, it will lead to errors. For example, one uses hibernate 2.0 and the other uses Hibernate 3.0, which can't work at the same time, and you didn't develop this project, so you can't let others modify the code.