Java install jar file windows

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.

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.

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.

Читайте также:  Mongodb config file windows

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 install JAR Files on Windows 10

  • JAR files are archives proprietary to Java development that contain compressed data.
  • Opening and installing JAR riles is not that easy, but we will show you how to do it below.
  • We will be covering both how to open JAR files on your PC and within your web browser.
  • This guide will be especially useful for those looking to run JAR-based games.

  • Opens over 300 file types
  • Edit, save and convert files
  • Batch file conversion

open all the files
in the same environment

Many of us enjoy playing games on Windows 10, and sometimes you might want to install an a.jar file in order to play games on Windows 10.

If you haven’t done this before, today we’re going to tell you how to install .jar files to play games on Windows 10.

How can I play JAR games on Windows 10?

Users report that .jar files don’t come with a standard icon and apparently they don’t work on Windows 10. If you want to play games such as Minecraft you’ll have to work with .jar files.

If you can’t run .jar files at all, then you have some problems with Java.

Before we start fixing this issue we have to mention that it’s a good idea that you run Windows Update in order to update your Windows 10 with the latest patches.

By updating Windows 10 you’ll prevent any potential incompatibility issues that you might have.

In order to run .jar files and Java games, you’ll need to have the latest version of Java. If you already have Java installed you should uninstall the version you have installed. To do so do the following:

  1. Open Control Panel and go to Programs and Features.
  2. On the list of installed software find Java and uninstall it.

After you’ve uninstalled Java you need to go to this site and download Java for your operating system. Make sure to download the right Java version for your Windows 10 version.

First of all, verify if you’re running a 32-bit or 64-bit Windows OS version. For more information, go to Java’s support page to learn what are the steps to follow.

2. Install Java on browsers

  1. Launch Internet Explorer
  2. Click on the Tools button (it looks like a cogwheel)
  3. Select Internet options
  4. Go to the Security tab, and select Custom level
  5. In the new pop-up menu, scroll down the list until you find Scripting of Java applet, and enable it
  6. Restart Internet Explorer.

Unfortunately, all other major web browsers no longer support Java, so Internet Explorer is your only chance as of now to run Java content on your browser.

After you’ve installed Java you should be able to run .jar files and play Java games on Windows 10.

We have to mention that this isn’t the best solution, but some users have reported that reinstalling and installing the latest version of Java on Windows 10 solved this issue.

If you’re experiencing any Java-related issues, here are some troubleshooting guides that you can use:

Читайте также:  Что такое классическое приложение windows

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.

. как установить Java на Windows?

Эта инструкция устарела, используйте вместо неё более новую

Во многих моих тренингах так или иначе используется Java, либо как язык программирования для разработки автотестов, либо как виртуальная машина для запуска приложений, написанных на Java — инструментов тестирования, сред разработки, и даже клиент системы видеоконференций GotoWebinar требует наличия Java.

Поэтому я решил описать процедуру установки Java для операционной системы Windows и последующей настройки системы, потому что, к сожалению, недостаточно просто “запустить инсталлятор и всегда нажимать кнопку Next”.

Читайте также:  Самая лучшая линукс система 2021

1. Где взять Java?

2. Какую версию выбрать?

Разумеется, последнюю доступную (на момент написания инструкции это Java 8).

Выбирая из 32-битной и 64-битной версий, берите 64-битную, если ваша операционная система это позволяет, потому что у неё менее строгие ограничения по памяти, доступной исполняемым Java-приложениям.

3. Что устанавливать, JRE или JDK?

Java Runtime Environment, или JRE — это виртуальная машина, позволяющая запускать приложения, написанные на языке программирования Java.

Java Development Kit, или JDK — это набор инструментов, для разработки программ на языке программирования Java (компилятор, архиватор, генератор документации и прочие). JRE разумеется тоже входит в дистрибутив JDK.

Правило очень простое: если вы собираетесь что-нибудь писать на языке программирования Java, значит вам потребуется JDK. А если только запускать готовые программы — тогда достаточно JRE.

4. Установка Java

Вот тут, действительно, всё просто — нужно запустить инсталлятор и следовать указаниям визарда. Можно просто всё время нажимать кнопку Next.

5. Настройка переменных окружения

К сожалению, инсталлятор Java не выполняет настройку переменных окружения, поэтому придётся сделать это вручную после установки.

Во-первых, необходимо установить переменную JAVA_HOME , которая должна указывать на директорию, в которую установлена Java. Многие программы используют эту переменную, чтобы определить, где находится Java.

Во-вторых, надо в переменную PATH добавить путь к директории %JAVA_HOME%\bin . Эта переменная указывает операционной системе список директорий, в которых нужно искать исполняемые файлы, и чтобы можно было запускать Java из консоли, переменная PATH должна быть правильно настроена.

Для установки переменных окружения сначала нужно открыть свойства компьютера, либо использовав сочетание клавиш Win-Pause, либо через меню “Пуск”:

Затем нужно выбрать “Дополнительные параметры системы”, в открывшемся диалоге перейти на вкладку “Дополнительно” и нажать кнопку “Переменные среды”, после чего появится диалог настройки переменных окружения.

Если у вас уже есть переменная окружения JAVA_HOME — надо её отредактировать, если нет — создать новую. В качестве значения нужно указать путь к директории, куда установлена Java, то есть, например c:\Program Files\Java\jdk1.8.0_25\ , если вы установили JDK, либо c:\Program Files\Java\jre1.8.0_25\ , если вы установили только JRE.

После того, как вы установили значение переменной JAVA_HOME , необходимо отредактировать значение переменной PATH, добавив туда путь к директории, где находятся исполняемые файлы Java, то есть %JAVA_HOME%\bin

И сохранить всё это, закрыв все открытые диалоги в обратном порядке кнопками OK.

Обратите внимание, что если вы устанавливаете JDK, то в названии директории указывается номер версии, поэтому впоследствии, когда вы решите установить более новую версию, не забудьте поменять значение переменной окружения JAVA_HOME .

После того, как вы изменили переменные окружения, новые значения будут действительны только для новых запускаемых программ, уже запущенные программы не узнают о том, что переменные окружения поменялись. Поэтому если вы, например, пытались запустить Java из консоли и у вас не получилось из-за неправильных настроек переменной PATH , вам придётся перезапустить консоль после того, как вы поменяли значение переменной.

6. Удаление лишних файлов

Запустите консоль ( cmd ) и выполните в ней команду where java .

В результате вы должны увидеть путь к исполняемому файлу java.exe , который операционная система должна успешно обнаружить в том месте, куда вы установили Java. Если файл не нашёлся — значит неправильно настроена переменная PATH и нужно вернуться к предыдущему пункту.

Однако иногда бывает и наоборот, находятся «лишние» исполняемые файлы:

Происходит это из-за того, что инсталлятор Java вместо того, чтобы правильно настроить переменные окружения, пытается положить исполняемые файлы в директорию C:\Windows\system32

Это не очень хорошо — засоряется системная директория, может возникнуть рассогласование версий Java (в разных директориях разные версии). Поэтому надо удалить из каталога C:\Windows\system32 исполняемые файлы java.exe , javaw.exe и javaws.exe , если они там обнаружатся.

Вот и всё, теперь можно пользоваться Java. Только не забывайте о том, что после установки новой версии надо будет обновить переменную окружения JAVA_HOME !

Автор: Алексей Баранцев

Если вам понравилась эта статья, вы можете поделиться ею в социальных сетях (кнопочки ниже), а потом вернуться на главную страницу блога и почитать другие мои статьи.
Ну а если вы не согласны с чем-то или хотите что-нибудь дополнить – оставьте комментарий ниже, может быть это послужит поводом для написания новой интересной статьи.

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