- How to open a jar file
- To run the file (Java Runtime Environment)
- To view the file (decompression)
- How to run a JAR file on Windows 10 [QUICK GUIDE]
- How can I run a JAR file on Windows 10?
- 1. Add Java to Windows
- 2. Download a JAR file opener
- File Viewer Plus
- 3. Use Java(TM) Platform SE binary
- 4. Run a JAR file from the Windows Command Prompt
- 5. Add a third-party JAR executor to Windows
- How to open or run a JAR file on Windows
- How to run a JAR file in Windows 10
- 1] Download and install Java Framework
- 2] Set System Path for Java
- 3] Run a Java or JAR file
- 4] Set the Java or JAR file association
- Running JAR file on Windows
- 25 Answers 25
How to open a jar file
To open a jar file in Windows, you must have the Java Runtime Environment installed. Alternatively, you can use decompression software, such as an unzip utility, to view the files in the jar archive.
To run the file (Java Runtime Environment)
To run the jar file, you need to download and install the Java Runtime Environment (if you do not have it already) from the link below.
Once downloaded, you can run any jar file by double clicking the file name. Keep in mind that this only works if the jar file to be opened is executable. If it’s not executable, you can view files within it instead.
If double-clicking the jar file does not result in the file being run, it’s likely not an executable file and cannot run in this manner. Read the next section on how to view the contents of the jar file.
If the jar file opens using an archive program, such as WinRAR or 7-Zip, and you want Java to open it instead, follow the instructions below. (The jar file must contain executable Java code for these steps to work.)
- Right-click the file and select Open With.
- In the Open With window, click the Browse button to open the File Explorer window.
- You need to find the Java executable file (java.exe file) on your computer hard drive. It is often located in the «Program Files\Java» or «Program Files (x86)\Java» folder, within a possible subfolder below the Java folder. Once you find the file, select it and click OK.
To view the file (decompression)
To view individual files in a non-executable jar file, you can obtain compression/decompression software that works with jar files. We recommend using either 7-Zip or WinRAR.
Once you have installed this software, run the software, open the jar file, and extract the files contained in it. Once the files are extracted, you can view the individual files by double clicking them. Many of those files are probably text files, but others may require additional software to view them.
If the jar file defaults to be opened with an archive program, such as WinRAR or 7-Zip, you can change the default program. To change the default program that opens jar files, right-click the jar file, select Open With, then Choose default program. In the Open With window, click the Browse button to open the File Explorer window. You need to find the executable file (.exe file) for the software program you want to set as the default program to open the jar file.
How to run a JAR file on Windows 10 [QUICK GUIDE]
- To run a JAR file on your Windows 10 device you certainly need to have Jave installed.
- You’ll find below a path to the latest Java version in case you need it.
- Then, you can find JAR file openers or executors, and we recommend some.
- Using Command Prompt is also a handy solution if you don’t want to install third-party tools.
A JAR file is a Java archive package format that might include a Java program within it. While you can extract JARs with archive software such as 7zip, you can’t run a pure Java JAR app as you would with other programs in Windows.
Since that’s the case, we’ll cover how you can run a pure Java app JAR file in Windows.
How can I run a JAR file on Windows 10?
1. Add Java to Windows
The crucial thing you need upfront is to have Java installed. Without it, Java apps aren’t going to run in Windows. This is how you can install or update Java in Windows 10:
- First, open Command Prompt(Admin) by pressing the Win key + R keyboard combination and entering cmd in the box.
- Next, input java -version in the Command Prompt and press Enter. It will then provide further details on your Java version as below.
- The current version of Java is Version 8 Update 131. If you don’t have Java or the most up-to-date version, you can add it for free.
- Run through the Java setup wizard. Then, open your browser to verify that the program is working.
2. Download a JAR file opener
You can open JAR files and hundreds of different formats with a single application. File Viewer Plus is a universal file viewer for Windows that can open and display over 300 different file types.
The new updated version has a plethora of features that will save you big time on opening, viewing, or editing files.
File Viewer Plus supports the most popular text, audio or video file type, as well as archive, source code or web files.
File Viewer Plus
3. Use Java(TM) Platform SE binary
- Open the File Explorer and the folder that includes the file you need to run.
- You should right-click the JAR file and select Open with from the context menu.
- Click Choose another app and then select to open it with Java(TM) Platform SE binary.
- Click the Always use this app to open JAR files check box.
- Press the OK button to close the menu.
- Now you can run the selected JAR, and all other JARfiles will also be associated with Java.
4. Run a JAR file from the Windows Command Prompt
- Press the Win key + X hotkey and select Command Prompt (Admin) to open it as administrator.
- Then input the following command (replacing the example with the actual path of the file you need to run) and press Enter: java -jar c:pathtojarfile.jar
- Alternatively, you can open the folder that includes the JAR in the Command Prompt first by entering cd / followed by the directory. Then, you can input java -jar file.jar without the folder path.
That will open the executable JAR file so long as it contains a manifest file to specify the application’s entry point. (The developers should have already included that in the archive.)
If you develop your own Java programs, you’ll need to convert the JAR to an executable format.
5. Add a third-party JAR executor to Windows
There are also executor programs for Windows that enable you to run JAR files the same as any other program . Jarx is one of them and you can add it to Windows by clicking Jarx-1.2-installer.exe on this page.
Click the jarx .exe to run the software, which doesn’t really have a GUI as such (except an About jarx window). Then you can double-click the JAR files to run them in Windows.
If you’re having trouble accessing the JAR file or you get some kind of an error, take a look at this nifty guide to finding some great fixes.
With all this, you can now run JAR files in Windows. If you need to fix a JAR file that isn’t opening, check out this Windows Report guide.
If you have any other suggestions or questions, leave them in the comments section below and we’ll be sure to take a look.
How to open or run a JAR file on Windows
JAR files are like EXE files except that they need a Java framework to run. Imagine them as EXE files on Windows which you can double click to launch the program. When you run an EXE file, it uses Windows OS support. Similarly, when you run JAR files, you need the help of Java Framework to open. When we say open JAR file, we are not opening the file like an archive file, but we are executing it. In this post, I will share how to open or run a JAR file on Windows 10.
While Archiver tools like 7-Zip can extract content from JAR files, but doing that is pointless – we need to execute the files just as we run the EXE files.
How to run a JAR file in Windows 10
Since Java files can’t run on Windows on its own, you need to install the Java Framework or what is popularly called as Java. That said, Java files can be dependent on a particular version of Java. You will need to take care of that as well.
- Download and install Java.
- Set System path
- Run the JAVA file
- Set Java file association.
1] Download and install Java Framework
To run a JAR file on Windows, you need to install Java on your system. Go to Java Download Page, and install it. The default will install the latest version only. However, if your JAR file needs a different version of Java, you can download it from here.
Sometimes, an existing older version of Java can cause an issue. So, if you are facing such a problem, make sure to remove the older version first. Use the official Java Remover tool to get rid of it. Then install the latest version.
2] Set System Path for Java
Next, you need to set the JAVA_HOME path. It makes sure that any JAVA file you run can find the necessary libraries for the program. You can also use the command line to echo the Java path to figure out if it is correct.
3] Run a Java or JAR file
Now when you double click on the JAR file, it will automatically run like how EXE files execute. If there is a problem with version, the file should inform you.
If you have a JAR file which is not running on its own, then you can use java JDK to run it. Open Command Prompt, and type java -jar name_of_jar_file.jar. It will execute the JAR file automatically.
4] Set the Java or JAR file association
The last step is to establish a file association with Java run time. It will make sure that every time you run, you are not asked to select a program which can execute it.
- Shift + Right-click on the file, and select Open with option.
- Select ‘Choose another app.’
- If Java(TM) Platform SE binary is not in your list, scroll, and then click on More Apps.
- And then choose Select app from the computer.
- You should see ‘Java(TM) Platform SE binary’ listed in this context menu but don’t select it.
- Locate the file which can run the JAVA or JAR file which is available in the path we suggested above.
- Make sure to check the box which says, “Always use this program.”
Once done, all future JAR files will automatically open with Java run time library. You should see the Java icon for all of these files.
We hope these tips where easy to understand, and were of help to open or run a Java file on Windows 10.
Running JAR file on Windows
I have a JAR file named helloworld.jar. In order to run it, I’m executing the following command in a command-line window:
This works fine, but how do I execute it with double-click instead? Do I need to install any software?
25 Answers 25
Easiest route is probably upgrading or re-installing the Java Runtime Environment (JRE).
- Open the Windows Explorer, from the Tools select ‘Folder Options. ‘
- Click the File Types tab, scroll down and select JAR File type.
- Press the Advanced button.
- In the Edit File Type dialog box, select open in Actions box and click Edit.
- Press the Browse button and navigate to the location the Java interpreter javaw.exe.
- In the Application used to perform action field, needs to display something similar to C:\Program Files\Java\j2re1.4.2_04\bin\javaw.exe» -jar «%1» % (Note: the part starting with ‘javaw’ must be exactly like that; the other part of the path name can vary depending on which version of Java you’re using) then press the OK buttons until all the dialogs are closed.
In Windows Vista or Windows 7, the manual file association editor has been removed.
The easiest way is to run Jarfix, a tiny but powerful freeware tool. Just run it and your Java apps is back. double-clickable again.
If you need to distribute your .jar file and make it runnable at other people’s Windows computers, you can make a simple .bat file like this in the command prompt:
and place the .bat file in the same directory as your .jar file.
If you have a jar file called Example.jar, follow these rules:
- Open a notepad.exe
- Write : java -jar Example.jar
- Save it with the extension .bat
- Copy it to the directory which has the .jar file
- Double click it to run your .jar file
An interesting side effect of this causes a problem when starting runnable jar files in the command prompt.
If you try (in a command prompt):
No joy, because this is being translated to the following (which doesn’t work):
However, the following command does work:
If you change the association in file manager as described above to:
Then you can type:
in the command prompt and it will now work!
EDIT:(However you then get a black console window when you run a form based (non console) Java app, so this is not an ideal solution)
If you run these jar files by double clicking them in windows, no parameters will be passed so your Java code needs to handle the stack overflow exception and include a «press a key» function at the end or the window will just disappear.
In order to pass a parameter in windows you have to create a shortcut to the jar file, which includes the parameter in the target line (right click on the shortcut and select properties) you can not add parameters to the jar file icon itself in this way.
There isn’t a single, consistent solution here, but you would have the same problem with any other console application.
There is a windows freeware application called «bat to exe» which you can use to create an exe file from a .bat file with the apropriate command line in it. you can also embed the jar file in the exe with this application, and make it clean it up when it has finished running, so this may be a more elegant solution.