简体   繁体   English

我可以将 jar 转换为 DLL 并将其注入正在运行的 Java 程序中吗?

[英]Can I convert jar into DLL and inject it into a running Java program?

I want to convert a jar package or class into a DLL file and inject the DLL into a running Java program through injection. I want to convert a jar package or class into a DLL file and inject the DLL into a running Java program through injection. This Java program can't use attach and agent, which makes me a headache.这个Java程序不能使用attach和agent,让我很头疼。 This should work, such as( Thanatos[1.12.2][1.635-v1].dll ) this is a DLL that can be injected into minecraft 1.12.2.这应该可以,例如( Thanatos[1.12.2][1.635-v1].dll )这是一个可以注入到 minecraft 1.12.2 中的 DLL。 I was told that it was made by j2d, but I searched all over the search engine and found no relevant knowledge.被告知是j2d制作的,但是我搜遍了搜索引擎,没有找到相关知识。

Besides the methods mentioned above, is there any other method to inject jar into the running Java program?除了上面提到的方法之外,还有其他方法可以将 jar 注入到正在运行的 Java 程序中吗?

Good luck祝你好运

Of course it is possible to add jars to running programs.当然可以将 jars 添加到正在运行的程序中。

As one example, look how application servers like Apache Tomcat deploy and undeploy applications (see https://tomcat.apache.org/tomcat-9.0-doc/deployer-howto.html ). As one example, look how application servers like Apache Tomcat deploy and undeploy applications (see https://tomcat.apache.org/tomcat-9.0-doc/deployer-howto.html ).

This is achieved by a clever combination of Classloaders as explained in https://tomcat.apache.org/tomcat-9.0-doc/class-loader-howto.html这是通过巧妙地组合类加载器来实现的,如https://tomcat.apache.org/tomcat-9.0-doc/class-loader-howto.ZFC35FDC70D5FC69D269883A822AEZC7中所述

Going through the DLL approach will just create more headache for you.通过 DLL 方法只会让您更加头疼。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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