简体   繁体   中英

How to add new jar file to existing deployed jar in server

I have a RMI application which is running on the server. Now i want to add external jar file to an existing deployed jar.

Note: It is not web application.

For example, here i mention the jar directories

MyApplication.jar

  • manifest.mf
  • .classpath
  • classes
    • My java class files
  • lib
    • test.jar
    • test1.jar
  • images
  • META-INF
    • MANIFEST.MF

.classpath has

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
  <classpathentry kind="src" path="src"/>
  <classpathentry kind="lib" path="lib/test.jar"/>
  <classpathentry kind="lib" path="lib/test1.jar"/>
  <classpathentry kind="output" path="classes"/>
</classpath> 

Now i want to add test2.jar to my lib folder inside MyApplication.jar and updating .classpath file.

Is it possible to add it?

If you cannot use JRebel then you will probably have to try to write your own class loader to achieve this. There are many pitfalls. See this answer and this question for some pointers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM