Jar file windows installer

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

  1. Open the File Explorer and the folder that includes the file you need to run.
  2. You should right-click the JAR file and select Open with from the context menu.
  3. Click Choose another app and then select to open it with Java(TM) Platform SE binary.
  4. Click the Always use this app to open JAR files check box.
  5. Press the OK button to close the menu.
  6. 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

  1. Press the Win key + X hotkey and select Command Prompt (Admin) to open it as administrator.
  2. 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
  3. 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.

Читайте также:  Пакет драйверов audio диспетчера realtek high definition для windows

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.

Create Windows Installer for Java Programs

I’m a Java beginner.

I already created a simple GUI application that display will «hello world» label.

But, how can I create an installer from .java or .jar for windows. Let’s say that I have created a useful application and want to share it with my friends to install it in their PC without they need to know what is JRE, or how to download JRE.

9 Answers 9

Deploy the app. from a web site using Java Web Start. Ensure the user has the minimum Java using deployJava.js (linked from the JWS info page).

Open Source Installers Generators in Java

IzPack

IzPack is an installers generator for the Java platform. It produces lightweight installers that can be run on any operating system where a Java virtual machine is available. Depending on the operating system, it can be launched by a double-click or a simple ‘java -jar installer.jar’ on a shell. The most common use is to distribute applications for the Java platform, but you can also use it for other kinds of projects. The main benefit of IzPack is that it provides a clean and unique way of distributing a project to users using different operating systems.

VAInstall

VAInstall is a multi-platform installer written in Java. It is distributed under the GNU GPL License 2. Through a simple config file, it allows the packager to pick files and directories from various places on disk, and not only one root dir like other installers. The packager can completely reorganize the files and dirs on the destination host. He can choose the install mode for the destination host (graphic, xtra, text or ansi).

Packlet

Packlet is a simple installer tool for Java. A packlet is similar to a zip or tgz file: it packages an application into a single compressed file that can be distributed. Packlet files are Java class files that can be executed on any machine with Java 2 Runtime Environment installed. Executing a packlet brings up an installer gui to configure and unpack the application.

Lift Off Java Installer

Lift Off Java Installer is an installer for Java applications. Highlights are self-extracting class files, minimal requirements for the Java installation on the target system, and cross platform installation.

Mini Installer

A simple package to build self installating programs in Java. The process is script driven, the result is a unique JAR file that the user can double click to execute a wizard-like installation process.

JSmooth

JSmooth is a Java Executable Wrapper that makes a standard Windows executable binary (.exe) from a jar file. It makes java deployment much smoother and user-friendly, as it is able to find a Java VM by itself. When no VM is available, it provides feed-back to the users, and can launch the default web browser to an URL that explains how to download a Java VM. Note: NOT COMPLETELY WRITTEN IN JAVA

Launch4J

Windows native executable (.exe) java application wrapper. Offers native splash screen, application icon, search for JRE or use bundled one, feedback on startup failure, passes command line arguments.

AntInstaller

AntInstaller is an installer framework which uses a simple XML file to define the UI, and Apache Ant as a back end. The installers can therefore do anything Ant can, and are compatible with Ant’s extension mechanism. Installers can be packaged as a selfextracting Jar and can run from the command line or a Swing GUI. AntInstall can also be used as a GUI front end for existing Ant builds.

Читайте также:  Уменьшение задержки windows 10

Antigen

Antigen (Ant Installer Generator) is a tool to take an Ant build script, combine it with a GUI and wrap it up as an executable jar file. Its primary purpose is to create powerful graphical installers from Ant scripts.

Java Service Wrapper

The Wrapper makes it possible to install a Java Application as a Windows NT Service. The scripts provided with the Wrapper also make it very easy to install those same Java Applications as daemon processes on UNIX systems. The Wrapper correctly handles user log outs under Windows, service dependencies, and the ability to run services which interact with the desktop.

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:

  1. Open a notepad.exe
  2. Write : java -jar Example.jar
  3. Save it with the extension .bat
  4. Copy it to the directory which has the .jar file
  5. 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.

Как запустить файл Jar в Windows 10 [БЫСТРОЕ РУКОВОДСТВО]

Файл Jar – это формат пакета архива Java, который может включать в себя программу Java. Хотя вы можете извлекать Jars с помощью программного обеспечения для архивирования, такого как 7zip, вы не можете запускать чистое приложение Java Jar, как это было бы с другими программами в Windows.

Читайте также:  Цветовой колориметр mac os hex

Поскольку это так, мы рассмотрим, как вы можете запустить чистый Jar-файл Java-приложения в Windows.

Как я могу запустить файл Jar в Windows 10?

  1. Добавить Java в Windows
  2. Откройте Jar-файл с помощью бинарного файла Java (TM) Platform SE
  3. Запустите файл JAR из командной строки Windows
  4. Добавить сторонний Jar Executor в Windows
  5. Загрузите этот инструмент, мы настоятельно рекомендуем

1. Добавить Java в Windows

Главное, что вам нужно сделать заранее – это установить Java. Без этого Java-приложения не будут работать в Windows. Вот как вы можете установить или обновить Java в Windows 10:

  • Сначала откройте командную строку (Admin), нажав комбинацию клавиш Win + R и введя «cmd» в подсказке.
  • Затем введите «java -version» в командной строке и нажмите Enter. Затем он предоставит дополнительную информацию о вашей версии Java, как показано ниже.

  • Текущая версия Java – Версия 8, обновление 131 . Если у вас нет Java или самой последней версии, вы можете добавить Версию 8 в Windows, нажав кнопку Бесплатная загрузка Java на этой странице веб-сайта.
  • Запустите мастер установки Java ниже, чтобы добавить Java 8 в Windows. Затем откройте браузер и убедитесь, что Java работает.

Подробнее о том, как добавить последнюю версию Java в Windows 10, читайте в этой обновленной статье.

2. Откройте файл Jar с двоичным файлом Java (TM) Platform SE

  • В последней версии Java теперь вы можете запускать файлы Jar. Откройте проводник и папку с файлом, который вам нужен для запуска.
  • Вы должны щелкнуть правой кнопкой мыши файл Jar и выбрать Открыть с помощью в контекстном меню.
  • Нажмите Выберите другое приложение , а затем выберите, чтобы открыть его с помощью бинарного файла Java (TM) Platform SE .

  • Установите флажок Всегда использовать это приложение, чтобы открывать файлы Jar .
  • Нажмите кнопку ОК , чтобы закрыть меню.
  • Теперь вы можете запустить выбранный Jar, и все другие файлы Jar также будут связаны с Java.

Epic guide alert! Больше нет проблем с Проводником. Исправьте их все с помощью этого обширного руководства!

3. Запустите файл Jar из командной строки Windows

  • Кроме того, вы можете запустить Jar из командной строки. Нажмите клавишу Win + горячую клавишу X и выберите Командная строка (Администратор) , чтобы открыть ее как администратор.
  • Затем введите java j -jar c: pathtojarfile.jar ’в CP и нажмите Enter. Замените c: pathtojarfile.jar на фактический путь и заголовок файла Jar, который вам нужно запустить в Windows.

  • Кроме того, вы можете сначала открыть папку с Jar в командной строке, введя «cd /», а затем каталог. Затем вы можете ввести «java -jar file.jar» без указания пути к папке.

Это откроет исполняемый файл Jar, если он содержит файл манифеста для указания точки входа приложения. (Разработчики должны были уже включить это в архив.)

Если вы разрабатываете свои собственные программы на Java, вам необходимо преобразовать Jar в исполняемый формат.

Если у вас возникли проблемы с доступом к командной строке от имени администратора, вам лучше ознакомиться с этим руководством.

4. Добавьте сторонний Jar Executor в Windows

Существуют также программы-исполнители для Windows, которые позволяют запускать файлы Jar так же, как и любые другие программы. Jarx – один из исполнителей Jar, который вы можете добавить в Windows, нажав Jarx-1.2-installer.exe на этой странице.

Нажмите на файл jarx.exe, чтобы запустить программное обеспечение, которое на самом деле не имеет графического интерфейса пользователя (кроме окна About jarx). Затем вы можете дважды щелкнуть Jar-файлы, чтобы запустить их в Windows.

Если у вас возникли проблемы с доступом к файлу JAR или у вас возникла какая-то ошибка, взгляните на это изящное руководство, чтобы найти отличные исправления.

5. Загрузите этот инструмент, мы настоятельно рекомендуем

Вы можете открывать файлы .jar и другие сотни различных форматов с помощью одного приложения. FileViewer Plus – это универсальный просмотрщик файлов для Windows, который может открывать и отображать более 300 различных типов файлов.

Новая обновленная версия имеет множество функций, которые сэкономят вам много времени при открытии, просмотре или редактировании файлов.Существует бесплатная полнофункциональная пробная версия, которую можно загрузить, так что вы можете проверить ее самостоятельно.

  • Загрузить сейчас FileViewer Plus 3

При этом теперь вы можете запускать файлы Jar в Windows. Если вам нужно исправить файл Jar, который не открывается, ознакомьтесь с этим руководством по Windows Report.

Если у вас есть другие предложения или вопросы, оставьте их в разделе комментариев ниже, и мы обязательно их рассмотрим.

Оцените статью