How to execute jar files easily and quickly under Windows environment __jabref

Source: Internet
Author: User

How to execute jar files easily and quickly in Windows environment

1 Introduction

A. jar file is a Java packaged file and typically contains a complete Java application. The most common practice for software acquired under Windows environments is a jar file:

1 Open the Command line window cmd.exe

2 Execute command: java–jar the corresponding jar file. Jar

As shown in the following illustration:

the disadvantage of doing so is obvious, cumbersome and time-consuming to operate. Obviously intolerable .

Then there is no better way. You can do this by writing a. bat script or by right-clicking the menu in the following way.

2 Windows Script run jar file

Suppose our JDK installation location is " C:\Java\jdk1.7.0_40_x86" and the jar file you want to run is "Jabref-3.0.jar". Then save the following as "execute Jabref3.bat" and put it under the same directory as the jar file. Click the bat file directly to run the appropriate jar file.

SET Java_home="C:\Java\jdk1.7.0_40_x86"

START C:\java\jdk1.7.0_40_x86\bin\javaw.exe–jar Jabref-3.0.jar

The trouble with this approach is that each jar file needs to create a corresponding bat script file.

3 Add a right-click menu to run the jar file

The right-click menu in the Windows system is very convenient for performing tasks. Corresponding to the jar file, if you can directly right-click the menu and then execute the appropriate jar file, is a time-saving thing. As shown in the following illustration:

Suppose our JDK installation location is " C:\Java\jdk1.7.0_40_x86", save the following as "Add _ Run Jar.reg", and then double-click the file to import content into the registry.

Windows Registry Editor Version 5.00

[Hkey_local_machine\software\classes\*\shell\jarrun]

@="Run Jar"

[Hkey_local_machine\software\classes\*\shell\jarrun\command]

@=' C:\\java\\jdk1.7.0_40_x86\\bin\\javaw.exe-jar \ '%1\ '

If you want to remove this right-click menu, save the following as "delete _ Run Jar.reg", as follows:

Windows Registry Editor Version 5.00

[-hkey_local_machine\software\classes\*\shell\jarrun]

[-hkey_local_machine\software\classes\*\shell\jarrun\command]


attached

1 The file of Jar suffix, its compression method is zip compress, can use compress class software such as 7-zip, Winzip,winrar opens directly.

2 refer to the document management software jabref Subsequent version, the file suffix name is no longer a. jar, but a. zip, which can also be run using this method.



Related Article

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.