Method for loading dynamic library in jar packet based on java

A technology of jar package and dynamic library, applied in the direction of program loading/starting, program control design, instruments, etc., can solve problems affecting software development, etc., to achieve the effect of easy promotion, wide application and cleanliness

CN106484467AInactive Publication Date: 2017-03-08INSPUR QILU SOFTWARE IND
3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Publication Date
2017-03-08
Estimated Expiration
Not applicable · inactive patent
Patent Text Reader

Abstract

The invention discloses a method for loading a dynamic library in a jar packet based on java. The realization process of the method comprises the steps of decompressing the dynamic library in the jar packet to a temporary file directory; and loading through an absolute path; and deleting the generated dynamic library when a program is finished. Compared with the prior art, the method for loading the dynamic library in the jar packet based on java has the advantages that loading can be carried out in the jar packet or at an appointed position in the jar packet, demands during loading the dynamic library are satisfied, cleanness of a system is ensured, the practicability is high, the application range is wide, and the method is easy to popularize.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention relates to the technical field of software development, in particular to a method for loading a dynamic library in a jar package by java with strong practicability. Background technique

[0002] Dynamic loading of jar packages is often used in actual development, especially when the relationship between the platform and business is involved, the business logic part can be independently handed over to the business side for management, and the business side only needs to provide the jar package, and the run.

[0003] In the method of the prior art, there is no method of loading the dynamic library in the jar package, but the java program exists in the form of a jar package for the external provider. At present, there is no method that can be specified in the jar package or inside the jar package. The location to load the dynamic library in the jar package seriously affects the progress of software development. In view of this, a method of ...

Examples

Embodiment Construction

[0017] The present invention will be further described below in conjunction with specific examples.

[0018] A method for java loading dynamic library in jar package of the present invention, its implementation process is: first decompress the dynamic library in the jar package to the temporary file directory, then load through absolute path, and delete the generated dynamic library at the end of the program.

[0019] Its specific implementation process is:

[0020] First read the dynamic library in the jar package in the form of a file stream. The dynamic library is determined by judging the system type, and the suffix of the dynamic library is suffix;

[0021] Then write the above read file stream into the temporary folder of the system in the form of byte stream through the file output stream;

[0022] Load the dynamic library;

[0023] Use the delete function to delete the generated dynamic library temporary file at the end of loading.

[0024] Determine the dynamic lib...