How to open JAR files in Windows and install JDK

How to open and run .jar files

What is a jar file? In daily network life, we often encounter some files with strange extensions that cannot be opened in Windows. For ordinary users, jar files are still relatively unfamiliar, but for programmers, jar is a commonly used java file. The following is a brief introduction on how to open a jar file in Windows.

On Windows 10 and Windows 11, this is not turned on by default. , as there is no built-in application that can handle this file format. However, you can install a free Java utility and access this file format on your PC. We will show you the process to do this.

How to open a JAR file in Windows-1

What is a JAR file?

In the software field, a JAR file (Java Archive) is a software package file format that is commonly used to aggregate a large number of Java class files, related metadata, and resource (text, images, etc.) files into one file in order to develop Java platform applications or libraries. A JAR file is an archive file built in ZIP format with a .jar file extension.

JAR stands for Java Archive, which is an archive that contains multiple files. Developers can make applications and other projects in Java and save these files as JARs. However, it is worth remembering that JAR files contain executable code, making them a potentially dangerous file type. Before running a JAR file, make sure you trust its source.

To run JAR files on a Windows PC, you must install the free Java utility. You can then double-click your JAR file to launch it.

How to Open a JAR File

Java programs must run on JVM, so the first thing we need to do is install JDK.

Java jdk download address:https://www.oracle.com/java/technologies/downloads/

Install JDK, JDK 21 is the latest long-term support version of the Java SE platform.

How to open a JAR file in Windows-1

x64 compressed archive185.52 MB
x64 Installer163.91 MB
x64 MSI Installer162.07MB

Select the appropriate operating system and installation package, find the download link of Java SE 21, download and install it. For Windows, choose x64 MSI Installer first. For Linux and macOS, choose the appropriate installation package according to whether your computer's CPU is ARM or x86.

After downloading, click Install JDK and click Next to install.

How to open JAR files in Windows and install JDK

How to open JAR files in Windows and install JDK

In this step, record the installation path and set the variables later.

How to open JAR files in Windows and install JDK

Click close to end the installation. After the installation is complete, you need to set variables, otherwise you will not be able to open the Java file.

Setting Environment Variables

After installing the JDK, you need to set a JAVA_HOME environment variable, which points to the installation directory of the JDK. Under Windows, it is the installation directory.

The following paths are used when setting java variables:

C:\Program Files\Java\jdk-21

To set environment variables, right-click This PC, select Properties, and then click Advanced System Settings in System Information. Select Environment Variables at the bottom to open the Environment Variable Settings window.

How to open JAR files in Windows and install JDK

Create a new JAVA_HOME variable

In System Variables, click New

How to open JAR files in Windows and install JDK

Variable Name: JAVA_HOME
Variable value: C:\Program Files\Java\jdk-21

The variable value is the value on the computerThe absolute path of the .

How to open JAR files in Windows and install JDK

Then add the bin variable to the system environment variable PATH

%JAVA_HOME%\bin Click New in System Environment Variables and add the above content. How to open JAR files in Windows and install JDK

Adding the bin directory of JAVA_HOME to PATH is to be able to run Java in any folder. Open the command prompt window and enter the command java -version. If everything goes well, you will see the following output:

How to open JAR files in Windows and install JDK

Many executable files are found in the bin directory of JAVA_HOME:

java: This executable program is actually the JVM. To run a Java program, you start the JVM and let the JVM execute the specified compiled code.
javac: This is the Java compiler, which is used to compile Java source code files (ending with the .java suffix) into Java bytecode files (ending with the .class suffix);
jar: used to package a group of .class files into a .jar file for easy distribution;
javadoc: used to automatically extract comments from Java source code and generate documentation;
jdb: Java debugger, used for running debugging during the development phase.

Another way to install java

Step 1: Is Java installed on your computer?

Check whether the machineIf Java is not installed, you need to install Java

During the run, enter cmd to enter the window command mode and enter:

jave -version

How to open a JAR file in Windows-1

If it displays "'jave' is not recognized as an internal or external command, operable program or batch file.", then you need to install Java on your local computer.

Step 2: Install Java

How do I install Java? Windows Download and Install Java is easy to download and install and is completely free. There are two ways to get Java for Windows.

Installing Java can be divided into two types: online download and offline download.

Download java online

The manual installation process requires the user to download an IFTW (Install From The Web) executable program file and requires a small amount of user operation. When the user runs this program, it will obtain all the required files from the Web, so during the installation process, the user must remain connected to the Internet.
To install Java on Microsoft Windows, administrator privileges are required.
If you have difficulty using the online download option, try the offline download option.
» Instructions for downloading and installing Java for Windows online

Download java offline

Offline installation requires users to download an executable file from the Manual Java Download page, which contains all the files they need to complete the installation themselves. Users do not need to be connected to the Internet during the installation process. Alternatively, the file can be copied to another computer that is not connected to the Internet.
To install Java on Microsoft Windows, administrator privileges are required.

Java platform support

Windows 2008 Server, Windows 7, Windows 8, Windows XP, Windows Server 2012, Windows Vista, Windows 10
Java version: 7.0, 8.0

Java download address

Access all java download installation addresses:https://www.java.com/zh-CN/download/manual.jsp

Recommended Version 8 Update 401
Release date: January 16, 2024

Important Oracle Java Licensing Information

The Oracle Java licensing changed with releases starting on April 16, 2019.

Oracle Technology Network License Agreement for Oracle Java SE This license is significantly different from previous Oracle Java licenses. This license permits certain free uses (such as personal use and development use), while other uses authorized under previous Oracle Java licenses may no longer be supported. Please read the terms carefully before downloading and using this product. Available atHereView frequently asked questions.

Through low-cost Java SE Subscription Get commercial licensing and technical support.

 

After installing Java, you may need to restart your browser to enable Java in your browser.

If you use 32-bit and 64-bit browsers interchangeably, you will need to install both 32-bit and 64-bit Java in order to have the Java plug-in for both browsers. » Frequently Asked Questions about 64-bit Java for Windows

For novice users, it is recommended to use online download and installation of Java. Online download and installation of Java can automatically determine the version required by the system.

After downloading, click Install:

How to open a JAR file in Windows-1

How to open a JAR file in Windows-1

How to open a JAR file in Windows-1

Once Java is installed, restart your Windows 10 or Windows 11 computer.

3.3/5 - (3 votes)

Leave a Reply

Your email address will not be published. Required fields are marked *