How the jar package turns into a DLL (can also be done with nested jars)

Source: Internet
Author: User

The study was good for a few days and finally succeeded. Because a Java project has been written, it is now required to be rewritten as a C # version. But it uses the Svnkit,svnkit is the Java platform. If you rewrite it to C #, use SHARPSVN, but SHARPSVN's API documentation is really unprofessional. It seems better to look at the Svnkit. So I'm going to write some operations (upload, download, delete, move, retrieve tree) and turn it into a DLL. So began the study.

The first problem is that there is a dependency between the jar packages, which turns into a DLL. A class-not-found error occurs during the run. Finally, a solution was found: there are two ways.

1. Use Fatjar to package them in one click (dependent packages can exist in the new Lib folder), then use

Ikvmc-target:library packaged Fatjar file path

To turn the jar package into a DLL.

Add a reference to the new C # project (add a well-forwarded DLL) and use the packaged function directly. (Just like using library functions)

2. The second approach is this:

Let me give you an example: A class named: GetUserName (), exporting it as a jar (Bedependent.jar). Write a class named Invokegetusername () and call GetUserName () in Invokegetusername (). Package the invokegetusername into another jar (Todependent.jar).

Next: The non-dependent jar package is first turned into a DLL, which is referred to as Bedependent.jar.

Ikvmc-target:library Bedependent.jar's Path

A BeDependent.dll is generated and then the two jar packages are synthesized:

Path of the Ikvmc-target:library-reference:bedependent.dll path Todependent.jar

Generate ToDependent.dll. After you load the reference in a new C # project, directly call Invokegetusername () directly in the program.

Note: But when I synthesized the jars of Svnkit, there was a problem. Hasn't been solved yet.

Http://www.cnblogs.com/wangjiyuan/p/jar2dll.html

How the jar package turns into a DLL (can also be done with nested jars) (RPM)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.