Java program execution method and device
A technology of program execution and program, which is applied in the field of Java program execution method and device, can solve problems such as occupation and multiple system resources, and achieve the effect of shortening time
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0061] The embodiment of the present invention provides a Java program execution method, see figure 1 , the method includes:
[0062] Step 101: Load a DLL (Dynamic Link Library, dynamic link library) file, where the DLL file includes: the implementation of the first Native method for creating the Powershell script execution environment pool, and the second Native method for executing the Powershell script realization.
[0063] This DLL file is used to execute Powershell scripts in Java programs.
[0064] Step 102: Invoke the first Native method to create a Powershell script execution environment pool, where the Powershell script execution environment pool includes multiple Powershell script execution environments.
[0065] Step 103: Invoke the second Native method to execute the Powershell script in the Java program in the Powershell script execution environment.
[0066] Step 104: Return the execution result of the Powershell script.
[0067] In the embodiment of the pres...
Embodiment 2
[0069] The embodiment of the present invention provides a Java program execution method, see figure 2 , the method includes:
[0070] Step 201: Obtain a Java file, where the Java file includes a declaration of the name of the DLL to be called, and declarations of the first Native method, the second Native method, and the third Native method.
[0071] Java files are compiled from Java code. The first Native method is used to create a Powershell script execution environment pool, the pool includes several script execution environments, and the number of script execution environments can be specified in the code. The third Native method is used to preload the Powershell script dependency class library in the above script execution environment for use during script execution. The second Native method is used to obtain an idle script execution environment from the script execution environment pool when the Powershell script needs to be executed, and then execute the Powershell s...
Embodiment 3
[0095] This embodiment of the present invention provides a Java program execution method. The difference between this embodiment and the second embodiment is that JNI4NET is used to implement compilation. See image 3 , the method includes:
[0096] Step 301: Acquire and compile C# code to generate a CS file, where the C# code includes the implementation of the first Native method, the second Native method and the third Native method.
[0097] The first Native method is used to create a Powershell script execution environment pool, the pool includes several script execution environments, and the number of script execution environments can be specified in the code. The third Native method is used to preload the Powershell script dependency class library in the above script execution environment for use during script execution. The second Native method is used to obtain an idle script execution environment from the script execution environment pool when the Powershell script ne...
PUM

Abstract
Description
Claims
Application Information

- R&D
- Intellectual Property
- Life Sciences
- Materials
- Tech Scout
- Unparalleled Data Quality
- Higher Quality Content
- 60% Fewer Hallucinations
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2025 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com