CN113918286A - Jar packet format localization method - Google Patents

Jar packet format localization method Download PDF

Info

Publication number
CN113918286A
CN113918286A CN202111487258.5A CN202111487258A CN113918286A CN 113918286 A CN113918286 A CN 113918286A CN 202111487258 A CN202111487258 A CN 202111487258A CN 113918286 A CN113918286 A CN 113918286A
Authority
CN
China
Prior art keywords
jar
localization
creating
program header
jar packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111487258.5A
Other languages
Chinese (zh)
Inventor
吴世洲
黄武
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Techman Software Co Ltd
Original Assignee
Chengdu Techman Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Techman Software Co Ltd filed Critical Chengdu Techman Software Co Ltd
Priority to CN202111487258.5A priority Critical patent/CN113918286A/en
Publication of CN113918286A publication Critical patent/CN113918286A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances

Abstract

The invention discloses a jar packet format localization method, which comprises the following steps: creating a localization program header, wherein the localization program header is used for guiding the jar packet to start; and enclosing the localization program header and the jar into a file. The invention provides a jar packet format localization method, after localization processing, jar packets can be directly opened by double-click at a PC (personal computer) end instead of using a command line or modifying a registry, and user experience is greatly improved.

Description

Jar packet format localization method
Technical Field
The invention relates to the technical field of computers, in particular to a jar packet format localization method.
Background
Java is an object-oriented language, and its programs have strong cross-platform capabilities. Generally, Java programs are packaged into jar or war packages and then used. At the PC side, Java programs are usually packaged into jar packages, however, the current method for opening jar packages at the PC side is relatively complex. Currently, the running mode of Windows can open jar packages by using the following methods: 1. opening a command line, and running java-jar xxx, jar (xxx is the package name of jar); 2. modifying the opening mode of a jar file, then finding 'HKEY _ CLASSES _ ROOT \ Applications \ java.exe \ shell \ open \ command' in a registry, adding a parameter '-jar' (no quotation mark) into a file opening command, wherein the modified numerical values are similar: "C: \ Program Files \ Java \ jre7\ bin \ javaw. exe-jar"% 1 ".
Disclosure of Invention
The invention aims to overcome one or more defects in the prior art and provides a jar packet format localization method.
The purpose of the invention is realized by the following technical scheme: a jar packet format localization method is characterized by comprising the following steps:
creating a localization program header, wherein the localization program header is used for guiding the jar packet to start;
and enclosing the localization program header and the jar into a file.
Preferably, creating a localization program header comprises:
analyzing a parameter list of a main function of the localization program header, wherein a first parameter in the parameter list is a program name of the localization program header, and all parameters except the first parameter in the parameter list are operation parameters of jar packets;
creating a running process of a jar packet by using an API (application programming interface) for creating the process in an operating system;
and transmitting a command line character string of a start jar packet for the corresponding parameter in the running process.
Preferably, the API for creating the process in the Windows system is CreateProcesses.
Preferably, the command line character string is java-jar name argv.
Preferably, the enclosing the localization program header and jar into one file comprises:
creating a new file;
writing all the localized program headers into the new file;
and completely writing the jar packet into the new file, wherein the start position of the jar packet in the new file is the end position of the localized program header in the new file.
The invention has the beneficial effects that: the invention provides a jar packet format localization method, after localization processing, jar packets can be directly opened by double-click at a PC (personal computer) end instead of using a command line or modifying a registry, and user experience is greatly improved.
Drawings
FIG. 1 is a block flow diagram of a jar packet format localization method;
FIG. 2 is a block flow diagram of creating a localization program header;
FIG. 3 is a block diagram of a process for combining a localization program header and jar into a file.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the following embodiments, and it should be understood that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive effort based on the embodiments of the present invention, are within the scope of the present invention.
Referring to fig. 1 to fig. 3, the embodiment provides a jar packet format localization method:
as shown in fig. 1, a jar packet format localization method includes:
s1, creating a localization program header, wherein the localization program header is used for guiding the jar packet to be started.
The localization program header is a program that can run directly on the operating system, such as an exe format program on a Windows system.
In some embodiments, as shown in FIG. 2, creating a localization program header includes:
s11, analyzing a parameter list of the main function of the localization program header, wherein a first parameter in the parameter list is a program name of the localization program header, and all the other parameters except the first parameter in the parameter list are operating parameters of jar packets.
And S12, creating the running process of the jar packet by using the API of the creating process in the operating system.
The API for creating a process in different operating systems is different, for example, the API for creating a process in a Windows system is CreateProcess, and the function of the API is defined as follows:
BOOL CreateProcess(
LPCTEST lpApplicationName,// application name
LPTSTR lpCommmandedline,// command line string
LPSECURITY _ ATTRIBUTES lpProcessAttributes,// Security Attribute of Process
LPSECURITY _ ATTRIBUTES lpTHREADATTRIBUTES,// thread's security ATTRIBUTES
BOOL bInheritHandles,// whether or not to inherit the parent process's attributes
DWORD dwCreationFlags,// CreationFlags flag
LPVOID lpENEnvironment,// pointer to new context Block
LPCTESTR lpCcurrentDirectory,// a pointer to the current directory name
LPSTARTUPINFO lpStartupInfo,// information passed to the new process
LPPROCESSS _ INFORMATION lpProcessinformation// INFORMATION returned by new process
);
And S13, transmitting a command line character string of a starting jar packet for the corresponding parameter in the running process.
Specifically, the command line character string is java-jar name argv.
And S2, combining the localization program header and the jar into a file.
In some embodiments, as shown in FIG. 3, enclosing the localization program header and jar into one file includes:
s21, creating a new file.
And S22, writing all the localized program headers into the new file.
S23, all the jar packets are written into the new file, and the starting position of the jar packets in the new file is the ending position of the localized program header in the new file.
Namely, reading the jar packet, and starting the writing of the jar packet at the position where the localization program head ends in the new file until the jar packet is completely written into the new file.
The foregoing is illustrative of the preferred embodiments of this invention, and it is to be understood that the invention is not limited to the precise form disclosed herein and that various other combinations, modifications, and environments may be resorted to, falling within the scope of the concept as disclosed herein, either as described above or as apparent to those skilled in the relevant art. And that modifications and variations may be effected by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (5)

1. A jar packet format localization method is characterized by comprising the following steps:
creating a localization program header, wherein the localization program header is used for guiding the jar packet to start;
and enclosing the localization program header and the jar into a file.
2. The method of claim 1, wherein creating a localization header comprises:
analyzing a parameter list of a main function of the localization program header, wherein a first parameter in the parameter list is a program name of the localization program header, and all parameters except the first parameter in the parameter list are operation parameters of jar packets;
creating a running process of a jar packet by using an API (application programming interface) for creating the process in an operating system;
and transmitting a command line character string of a start jar packet for the corresponding parameter in the running process.
3. The method of claim 2, wherein the API of the creating process in the Windows system is CreateProcess.
4. The method of claim 2, wherein the command line string is java-java name argv.
5. The method for localizing the packet format of jar as claimed in claim 1, wherein the step of enclosing the localization program header and the jar into a file comprises:
creating a new file;
writing all the localized program headers into the new file;
and completely writing the jar packet into the new file, wherein the start position of the jar packet in the new file is the end position of the localized program header in the new file.
CN202111487258.5A 2021-12-08 2021-12-08 Jar packet format localization method Pending CN113918286A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111487258.5A CN113918286A (en) 2021-12-08 2021-12-08 Jar packet format localization method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111487258.5A CN113918286A (en) 2021-12-08 2021-12-08 Jar packet format localization method

Publications (1)

Publication Number Publication Date
CN113918286A true CN113918286A (en) 2022-01-11

Family

ID=79248661

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111487258.5A Pending CN113918286A (en) 2021-12-08 2021-12-08 Jar packet format localization method

Country Status (1)

Country Link
CN (1) CN113918286A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030131320A1 (en) * 2002-01-08 2003-07-10 International Business Machines Corporation Method and system for localizing java jar files
CN103353844A (en) * 2013-06-25 2013-10-16 亿赞普(北京)科技有限公司 Upgrading method and system of SDK (software development kit)
CN107179907A (en) * 2017-05-15 2017-09-19 北京奇艺世纪科技有限公司 One kind configuration system and method
CN107193748A (en) * 2017-06-01 2017-09-22 网易(杭州)网络有限公司 Program file performs method, device, storage medium and processor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030131320A1 (en) * 2002-01-08 2003-07-10 International Business Machines Corporation Method and system for localizing java jar files
CN103353844A (en) * 2013-06-25 2013-10-16 亿赞普(北京)科技有限公司 Upgrading method and system of SDK (software development kit)
CN107179907A (en) * 2017-05-15 2017-09-19 北京奇艺世纪科技有限公司 One kind configuration system and method
CN107193748A (en) * 2017-06-01 2017-09-22 网易(杭州)网络有限公司 Program file performs method, device, storage medium and processor

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
DARTAGNAN: "将jar文件做成exe可运行文件", 《HTTPS://WWW.CNBLOGS.COM/DARTAGNAN/ARCHIVE/2010/12/09/2003517.HTML》 *
JAVAZHUANZAI: "JAVA如何生成可执行程序?", 《HTTPS://BLOG.CSDN.NET/JAVAZHUANZAI/ARTICLE/DETAILS/7189129》 *
SEGEN_JAA: "C++调用Java的Jar包", 《HTTPS://BLOG.CSDN.NET/SEGEN_JAA/ARTICLE/DETAILS/28634877》 *
蓝蓝223: "把可执行jar打包成exe文件", 《HTTPS://BLOG.CSDN.NET/QQ_21808961/ARTICLE/DETAILS/83002500》 *

Similar Documents

Publication Publication Date Title
US6460058B2 (en) Object-oriented framework for hyperlink navigation
CN111381938B (en) Method and system for executing intelligent contracts in block chain based on basic instruction set
US6675230B1 (en) Method, system, and program for embedding a user interface object in another user interface object
US6980979B2 (en) Method and apparatus for customizing Java API implementations
US6904600B1 (en) Application programming interface to the simple object access protocol
US7353287B2 (en) Marked foreign data blocks
CN101458754B (en) Method and apparatus for monitoring application program action
WO2015074548A1 (en) Method for sound control in browser, and browser
BRPI0909213B1 (en) method for implementing editing features for an application program and computer adapted to run a web browser and have a system clipboard
CN102945347A (en) Method, system and device for detecting Android malicious software
US8499044B2 (en) Formatted message processing utilizing a message map
CN110187986B (en) Command management method, system, device and computer readable storage medium
CN113918286A (en) Jar packet format localization method
US20180089432A1 (en) System and method for characterizing malware
US7814408B1 (en) Pre-computing and encoding techniques for an electronic document to improve run-time processing
US8667390B2 (en) Asynchronous access to structured data
US6260083B1 (en) System for Java data block transfers of unknown length for applets and applications by determining length of data in local buffer and passing length of data combined with data out of program
CN113778515B (en) Method and device for determining program package change information
US20080109818A1 (en) Shortcut IP Communications Between Software Entities in a Single Operating System
CN107818020B (en) Parameter transmission method and device
CN114491557A (en) Java memory Trojan horse threat detection method based on container environment
KR20080087865A (en) External configuration of processing content for script
KR100538801B1 (en) Graphic User Interface Providing System And Method Wireless Terminal Applications
CN110286940A (en) Smart television log generation method
JP2003186674A (en) Presentation of java data types in virtual machine

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20220111

RJ01 Rejection of invention patent application after publication