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
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
Abstract
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...