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. 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. I was told that it was made by j2d, but I searched all over the search engine and found no relevant knowledge.
Besides the methods mentioned above, is there any other method to inject jar into the running Java program?
Good luck
Of course it is possible to add jars to running programs.
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
Going through the DLL approach will just create more headache for you.