Меню

Ошибка unable to access jarfile bin dpu как исправить

Содержание

  • 1 Что вызывает ошибку «Невозможно получить доступ к Jarfile»?
    • 1.1 Решение 1. Установка последнего обновления Java
    • 1.2 Решение 2. Настройка файловой ассоциации по умолчанию
    • 1.3 Решение 3. Проверка на наличие вредоносных программ
    • 1.4 Решение 4. Проверка документации (для разработчиков)

JAR — это формат файла пакета, который используется многими файлами классов Java со связанными метаданными и ресурсами для упаковки в один пакет для распространения. Они построены на архитектуре ZIP и имеют расширение .jar.

Не удалось открыть jarfileНе удалось открыть jarfile

Пользователи испытывают ошибку «Не удалось открыть jarfile”, Когда они либо пытаются открыть пакет .JAR, либо приложение запрашивает их, если не удается запустить. Это сообщение об ошибке очень распространено и означает, что у вас не установлены корректные обработчики для .JAR.

Что вызывает ошибку «Невозможно получить доступ к Jarfile»?

Это сообщение об ошибке может быть вызвано несколькими причинами, но большинство из них связано с обработкой файлов .JAR на вашем компьютере. Причины этой ошибки, но не ограничиваются:

  • У вас нет последний JAVA версия установлена ​​на вашем компьютере. Для эффективного запуска файлов JAR необходимо, чтобы на вашем компьютере была установлена ​​необходимая последняя платформа.
  • программа по умолчанию для открытия файлов JAR не установлен.
  • Вредоносное присутствует на вашем компьютере, что может повлиять на весь процесс.
  • Путь файла установлен для исполняемого файла Java неверно и указывает на неправильное местоположение. Это может вызвать сообщение об ошибке при загрузке компьютера.

Прежде чем переходить к решениям, убедитесь, что у вас есть активное подключение к Интернету и привилегии учетной записи администратора.

Решение 1. Установка последнего обновления Java

Как упоминалось ранее, для программ, запускающих файлы JAR, на вашем компьютере должна быть установлена ​​правильная архитектура, т. Е. Java. Кроме того, это должна быть последняя версия, выпущенная для пользователей. Если у вас не установлена ​​Java, вы можете напрямую загрузить и установить ее. Если у вас более старая версия, мы сначала удалим ее, а затем установим последнюю с официального сайта.

  1. Нажмите Windows + R, введите «appwiz.компл”В диалоговом окне и нажмите Enter.
  2. Попав в диспетчер приложений, найдите запись Java. Щелкните правой кнопкой мыши и выберите Удалить.

Удаление старой JavaУдаление старого Java — менеджера приложений

  1. После удаления приложения перейдите на официальный веб-сайт Java и загрузите последнюю версию. После загрузки исполняемого файла запустите его, чтобы установить последнюю версию Java.
  2. Перезагрузите компьютер и проверьте, устранено ли сообщение об ошибке.

Решение 2. Настройка файловой ассоциации по умолчанию

Также может появиться сообщение об ошибке: Java не установлен в качестве обработчика по умолчанию для файлов JAR на вашем компьютере. Программа архивации может быть выбрана в качестве средства открытия JAR-файлов по умолчанию, что может не дать ожидаемого результата. Мы можем попробовать изменить сопоставление файлов и проверить, устраняет ли это проблему.

  1. Перейдите в каталог, где находится файл JAR. Щелкните правой кнопкой мыши и выберите Открыть с и выберите программу Java.

Открытие JAR-файлов с помощью JavaОткрытие JAR-файлов с помощью Java

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

Нажмите Windows + I, чтобы запустить настройки. Теперь перейдите к Программы и выберите Приложения по умолчанию с левой панели навигации.

  1. Теперь нажмите Выберите приложения по умолчанию по типу файла присутствует в нижней части. Теперь найдите входные файлы .jar и убедитесь, что он выбран для открытия в Java.

Изменение файловой ассоциации по умолчаниюИзменение файловой ассоциации по умолчанию

  1. Сохранить изменения и выйти. Перезагрузите компьютер и проверьте, устранено ли сообщение об ошибке.

Решение 3. Проверка на наличие вредоносных программ

Если вы по-прежнему получаете сообщение об ошибке при запуске операционной системы или любой другой программы, вам следует проверить, нет ли на вашем компьютере вирусов или вредоносных программ. Эти объекты используют ваш реестр и после изменения нескольких ключей делают JAR-файл непригодным для использования.

Сканирование с использованием MalwareBytesСканирование с использованием вредоносных байтов

Вы должны выполнить тщательную проверку на своем компьютере, а затем выполнить Решение 1, чтобы убедиться, что все записи и ассоциации файлов удалены, а затем переделаны при переустановке Java. Вы проверяете нашу статью о том, как удалить вредоносное ПО, используя Malwarebytes.

Решение 4. Проверка документации (для разработчиков)

Разработчики также испытывают это сообщение об ошибке, когда они пытаются запустить файлы JAR, когда они кодируют с Java или другим языком. Это может быть очень хлопотно и, вероятно, остановит вашу задачу под рукой.

Ошибка кодирования JavaОшибка кодирования Java

Для диагностики и устранения ошибки рекомендуется прочитайте документацию по функции или утилиту, которую вы используете для открытия или запуска файлов JAR. Возможно, вы неправильно указали путь к файлу или, возможно, передали неверные параметры в функцию. Вы можете легко получить демонстрации функций, которые вы пытаетесь реализовать на популярных веб-сайтах по кодированию, таких как Stack Overflow. Определите свою ошибку и исправьте ее, прежде чем снова запустить программу / функцию.

Changing the default app for JAR files should fix this issue

by Matthew Adams

Matthew is a freelancer who has produced a variety of articles on various topics related to technology. His main focus is the Windows OS and all the things… read more


Updated on November 17, 2022

Reviewed by
Alex Serban

Alex Serban

After moving away from the corporate work-style, Alex has found rewards in a lifestyle of constant analysis, team coordination and pestering his colleagues. Holding an MCSA Windows Server… read more

  • The Unable to access the JAR file is a standard error when you don’t have compatible software to open it.
  • Some users reported that using stable file openers fixed the issue for them.
  • You can also fix this issue by uninstalling and downloading the latest version of Java.

unable to access jarfile

XINSTALL BY CLICKING THE DOWNLOAD FILE

To fix various PC problems, we recommend Restoro PC Repair Tool:
This software will repair common computer errors, protect you from file loss, malware, hardware failure and optimize your PC for maximum performance. Fix PC issues and remove viruses now in 3 easy steps:

  1. Download Restoro PC Repair Tool that comes with Patented Technologies (patent available here).
  2. Click Start Scan to find Windows issues that could be causing PC problems.
  3. Click Repair All to fix issues affecting your computer’s security and performance
  • Restoro has been downloaded by 0 readers this month.

Java browser plug-ins might have gone out of fashion, but many programs run off Java. For example, you can open Java programs with JarFiles, among other software for opening JAR files.

However, some Java software users can’t always open JAR programs with the Unable to access JarFile error message popping up. This guide will show you some practical ways to get past this error message.

Why does it say unable to access jar?

The inability to access JarFile on Minecraft or Forge can be caused by mistakes on your path or issues with the software. Below are some of the prevalent causes:

  • Outdated Java version: If your Java version is obsolete, you cannot access JarFile using the docker container. You need to update Java to the latest version.
  • Wrong default program: Sometimes, this issue might be because you have not set the default program to open the JarFiles. Choosing Java as the default app for opening JAR files should fix this.
  • Issues with the JAR file path: If the path to your jar file is incorrect, you can get this error. The solution here is to ensure the path is correct.

How can I fix the unable to access JarFile error?

Before proceeding to the fixes in this guide, try the preliminary troubleshooting steps below:

  • Add .jar extension to the JAR file name
  • Beware of spaces in the JAR file path
  • Add quotes to the JAR file path if it contains space
  • Move the JAR file to another folder
  • Use a file opener software

If the fixes above fail to solve the issue, you can now move to the fixes below:

1. Update your Java version

  1. Press the Windows key + R, type appwiz.cpl, and click OK.
    appwiz unable to access jarfile
  2. Right-click the Java app and select the Uninstall option.
    uninstall
  3. Now, go to the official website to download the latest version of the Java app.

A broken or outdated app can cause the unable to access the JarFile issue. Downloading the latest version of the app should fix the problem.

2. Select Java as the default program for JarFiles

  1. Open File Explorer and the folder that includes your JAR file.
  2. Right-click the file and select Open with, and then Choose another app.
    choose another
  3. Select Java if it’s listed among the default programs.
  4. If Java isn’t listed among the programs, select the Look for another app on this PC option.
    look for unable to access jarfile
  5. Then browse to the Java bin folder, select  Java and press the Open button.

JAR file error messages usually pop up when Java isn’t configured as the default software for a JAR file. This can be the cause of the unable to access JarFile.

Setting Java as the default program should fix the issue here.

Read more about this topic

  • Unable to Connect to Nvidia Try Again Later: 3 Error Fixes
  • 4 Best Bengali Typing Software for Windows 10 [Free Download]
  • Projector Not Turning On: Why & How to Fix [Epson, Dr.J]
  • Fix: You Have Been Denied Permission to Access This Folder
  • Chassis Intruded Fatal Error System Halted: How to Fix

3. Open the Jarfix Software

  1. Click jarfix.exe on this webpage to save the software to a folder.
    jarfix download
  2. Now, open the folder and double-click the jarfix.exe option.
    open jarfix unable to access jarfile
  3. The tool will start and fix issues with your jar file extension.
    jarfix success

In some cases, the unable to access JarFile issue on IntelliJ can be because of problems with the file type associations. This Jarfix.exe software will help you fix this issue and restore normalcy on your PC.

Those are a few resolutions that might fix the unable to access JarFile error and kick-start your Java software. After that, you only need to follow the instructions carefully, and the issue should be resolved.

For further details on installing a JAR file in Windows 10, check our guide to make the process easy.

If you have any other questions, please leave them in the comments section below.

Still having issues? Fix them with this tool:

SPONSORED

If the advices above haven’t solved your issue, your PC may experience deeper Windows problems. We recommend downloading this PC Repair tool (rated Great on TrustPilot.com) to easily address them. After installation, simply click the Start Scan button and then press on Repair All.

newsletter icon

Newsletter

Changing the default app for JAR files should fix this issue

by Matthew Adams

Matthew is a freelancer who has produced a variety of articles on various topics related to technology. His main focus is the Windows OS and all the things… read more


Updated on November 17, 2022

Reviewed by
Alex Serban

Alex Serban

After moving away from the corporate work-style, Alex has found rewards in a lifestyle of constant analysis, team coordination and pestering his colleagues. Holding an MCSA Windows Server… read more

  • The Unable to access the JAR file is a standard error when you don’t have compatible software to open it.
  • Some users reported that using stable file openers fixed the issue for them.
  • You can also fix this issue by uninstalling and downloading the latest version of Java.

unable to access jarfile

XINSTALL BY CLICKING THE DOWNLOAD FILE

To fix various PC problems, we recommend Restoro PC Repair Tool:
This software will repair common computer errors, protect you from file loss, malware, hardware failure and optimize your PC for maximum performance. Fix PC issues and remove viruses now in 3 easy steps:

  1. Download Restoro PC Repair Tool that comes with Patented Technologies (patent available here).
  2. Click Start Scan to find Windows issues that could be causing PC problems.
  3. Click Repair All to fix issues affecting your computer’s security and performance
  • Restoro has been downloaded by 0 readers this month.

Java browser plug-ins might have gone out of fashion, but many programs run off Java. For example, you can open Java programs with JarFiles, among other software for opening JAR files.

However, some Java software users can’t always open JAR programs with the Unable to access JarFile error message popping up. This guide will show you some practical ways to get past this error message.

Why does it say unable to access jar?

The inability to access JarFile on Minecraft or Forge can be caused by mistakes on your path or issues with the software. Below are some of the prevalent causes:

  • Outdated Java version: If your Java version is obsolete, you cannot access JarFile using the docker container. You need to update Java to the latest version.
  • Wrong default program: Sometimes, this issue might be because you have not set the default program to open the JarFiles. Choosing Java as the default app for opening JAR files should fix this.
  • Issues with the JAR file path: If the path to your jar file is incorrect, you can get this error. The solution here is to ensure the path is correct.

How can I fix the unable to access JarFile error?

Before proceeding to the fixes in this guide, try the preliminary troubleshooting steps below:

  • Add .jar extension to the JAR file name
  • Beware of spaces in the JAR file path
  • Add quotes to the JAR file path if it contains space
  • Move the JAR file to another folder
  • Use a file opener software

If the fixes above fail to solve the issue, you can now move to the fixes below:

1. Update your Java version

  1. Press the Windows key + R, type appwiz.cpl, and click OK.
    appwiz unable to access jarfile
  2. Right-click the Java app and select the Uninstall option.
    uninstall
  3. Now, go to the official website to download the latest version of the Java app.

A broken or outdated app can cause the unable to access the JarFile issue. Downloading the latest version of the app should fix the problem.

2. Select Java as the default program for JarFiles

  1. Open File Explorer and the folder that includes your JAR file.
  2. Right-click the file and select Open with, and then Choose another app.
    choose another
  3. Select Java if it’s listed among the default programs.
  4. If Java isn’t listed among the programs, select the Look for another app on this PC option.
    look for unable to access jarfile
  5. Then browse to the Java bin folder, select  Java and press the Open button.

JAR file error messages usually pop up when Java isn’t configured as the default software for a JAR file. This can be the cause of the unable to access JarFile.

Setting Java as the default program should fix the issue here.

Read more about this topic

  • Unable to Connect to Nvidia Try Again Later: 3 Error Fixes
  • 4 Best Bengali Typing Software for Windows 10 [Free Download]
  • Projector Not Turning On: Why & How to Fix [Epson, Dr.J]

3. Open the Jarfix Software

  1. Click jarfix.exe on this webpage to save the software to a folder.
    jarfix download
  2. Now, open the folder and double-click the jarfix.exe option.
    open jarfix unable to access jarfile
  3. The tool will start and fix issues with your jar file extension.
    jarfix success

In some cases, the unable to access JarFile issue on IntelliJ can be because of problems with the file type associations. This Jarfix.exe software will help you fix this issue and restore normalcy on your PC.

Those are a few resolutions that might fix the unable to access JarFile error and kick-start your Java software. After that, you only need to follow the instructions carefully, and the issue should be resolved.

For further details on installing a JAR file in Windows 10, check our guide to make the process easy.

If you have any other questions, please leave them in the comments section below.

Still having issues? Fix them with this tool:

SPONSORED

If the advices above haven’t solved your issue, your PC may experience deeper Windows problems. We recommend downloading this PC Repair tool (rated Great on TrustPilot.com) to easily address them. After installation, simply click the Start Scan button and then press on Repair All.

newsletter icon

Newsletter

На чтение 4 мин. Просмотров 1.7k. Опубликовано 03.09.2019

Возможно, плагины для браузера Java вышли из моды, но есть еще много программ, работающих на Java. Вы можете открывать программы Java с файлами JAR. Однако некоторые пользователи программного обеспечения Java не всегда могут открывать JAR-программы, когда появляется сообщение об ошибке « Ошибка: невозможно получить доступ к jarfile ». Вот несколько решений для сообщения об ошибке jarfile.

Содержание

  1. Ошибка: невозможно получить доступ к jarfile
  2. 1. Добавьте самую последнюю версию Java в Windows
  3. 2. Выберите Java в качестве программы по умолчанию для файлов JAR.
  4. 3. Выберите параметр Показать скрытые файлы, папки и диски.
  5. 4. Откройте программное обеспечение Jarfix

Ошибка: невозможно получить доступ к jarfile

  1. Добавить самую последнюю версию Java в Windows
  2. Выберите Java в качестве программы по умолчанию для файлов JAR
  3. Выберите «Показать скрытые файлы, папки и диски».
  4. Откройте программное обеспечение Jarfix

1. Добавьте самую последнюю версию Java в Windows

Во-первых, убедитесь, что у вас установлена ​​самая последняя версия Java. Самая последняя версия – это Java 8 161. Таким образом, вы можете обновить Java в Windows 10.

  • Сначала нажмите сочетание клавиш Win + R, чтобы открыть команду «Выполнить».
  • Введите «appwiz.cpl» в текстовое поле «Выполнить» и нажмите кнопку ОК .
  • Введите «Java» в поле поиска «Поиск программ», как показано на снимке ниже.

  • Затем выберите Java, чтобы проверить, какая у вас версия. Версия отображается в нижней части окна и отображается в столбце Версия.
  • Если у вас не установлена ​​самая последняя версия Java, нажмите кнопку Удалить .
  • Нажмите кнопку Да , чтобы подтвердить.
  • Откройте эту веб-страницу в вашем браузере.

  • Нажмите кнопку Бесплатная загрузка Java , чтобы сохранить мастер установки JRE.
  • После этого может открыться диалоговое окно, из которого можно нажать кнопку Выполнить , чтобы запустить установщик JRE. Если нет, откройте папку, в которой вы сохранили мастер установки, щелкните правой кнопкой мыши мастер установки Java и выберите Запуск от имени администратора .
  • Нажмите кнопку Установить в окне мастера установки, чтобы установить Java.

2. Выберите Java в качестве программы по умолчанию для файлов JAR.

Сообщения об ошибках Jarfile обычно появляются, когда Java не настроена в качестве программного обеспечения по умолчанию для файла JAR. Вместо этого утилита архивирования может быть связанной программой по умолчанию для JAR. Таким образом, выбор Java в качестве программы по умолчанию для файла JAR может запустить его программу. Вот как вы можете настроить программное обеспечение по умолчанию для формата JAR.

  • Откройте проводник и папку, в которой находится файл JAR.
  • Нажмите правой кнопкой мыши файл JAR и выберите Открыть с помощью > Выберите программу по умолчанию > Выберите другое приложение , чтобы открыть окно на снимке прямо ниже.

  • Выберите Java, если он указан среди программ по умолчанию.
  • Если в списке программ нет Java, выберите параметр Искать другое приложение на этом ПК .
  • Затем перейдите в папку Java, выберите Java и нажмите кнопку Открыть .
  • Нажмите кнопку ОК в окне Открыть с помощью.
  • Нажмите на JAR, чтобы запустить его программу.

ТАКЖЕ ЧИТАЙТЕ: я не могу открыть Steam в Windows 10: как я могу решить эту проблему?

3. Выберите параметр Показать скрытые файлы, папки и диски.

  • Сообщение об ошибке « невозможно получить доступ к jarfile » также может появиться, если не выбран параметр Показать скрытые файлы, папки и диски . Чтобы выбрать эту опцию, откройте проводник.
  • Перейдите на вкладку “Вид” и нажмите кнопку Параметры , чтобы открыть окно, расположенное ниже.

  • Выберите вкладку «Вид», показанную ниже.

  • Выберите Показать скрытые файлы, папки и диски Файлы и папки.
  • Нажмите кнопку Применить .
  • Нажмите кнопку ОК , чтобы закрыть окно.

4. Откройте программное обеспечение Jarfix

Jarfix – это легковесная программа, предназначенная для исправления не запускающихся Java-программ. Программа исправляет ассоциации типов файлов JAR. Нажмите jarfix.exe на этой веб-странице, чтобы сохранить программное обеспечение в папке. Затем вы можете щелкнуть jarfix.exe, чтобы открыть окно ниже и исправить сопоставление JAR. Это все, что нужно сделать, и в окне Jarfix больше нет вариантов для выбора.

Это несколько решений, которые могут исправить ошибку « невозможность доступа к jarfile » и запустить программное обеспечение JAR. Для получения дополнительной информации о том, как запустить файлы JAR в Windows, ознакомьтесь с этой статьей.

Я хочу выполнить свою программу без использования IDE.
Я создал файл jar и exectuable jar файл. когда
Я дважды щелкаю по файлу exe jar, ничего не происходит, и когда я пытаюсь использовать команду в cmd, это дает мне следующее:

Error: Unable to access jarfile <path>

Я использую команду: java -jar Calculator.jar

Как я создал банку:

  • Щелкните правой кнопкой мыши папку проекта (Калькулятор)
  • Выберите
  • Нажмите «Папка Java» и выберите «Exectuable Jar File», затем выберите следующий
  • Конфигурация запуска: Главная — Калькулятор
  • Создать назначение экспорта
  • Хит «Готово» и прибыль! Ну, не совсем.

4b9b3361

Ответ 1

Fixed

Я просто поместил его в другую папку, и он сработал.

Ответ 2

Я столкнулся с этой проблемой, когда я запустил файл Jar как

java -jar TestJar

вместо

java -jar TestJar.jar

Отсутствие расширения .jar также вызывает эту проблему.

Ответ 3

[Возможно только для Windows]

Остерегайтесь пробелов в пути, даже если ваша банка находится в текущем рабочем каталоге. Например, для меня это не срабатывало:

java -jar myjar.jar

Я смог исправить это, указав полный, процитированный путь к банке:

java -jar "%~dp0myjar.jar" 

Кредит переходит к этому ответу для установки меня по правильному пути….

Ответ 4

У меня была проблема с CygWin в Windows. Я читал в другом месте, что Java не понимает пути CygWin (/cygdrive/c/some/dir вместо C:somedir) — поэтому вместо этого я использовал относительный путь: ../../some/dir/sbt-launch.jar.

Ответ 5

Просто наткнулась на ту же проблему, пытаясь сделать плохой USB…

Я попытался запустить эту команду в admin cmd

java -jar c:fwduckyduckencode.jar -I c:fwduckyHelloWorld.txt  -o c:fwduckyinject.bin

Но получилась эта ошибка:

Error: unable to access jarfile c:fwduckyduckencode.jar

Решение

1-й шаг

Щелкните правой кнопкой мыши соответствующий jarfile. Щелкните свойства.
Перейдите на вкладку разблокирования в нижнем правом углу.
Файл был заблокирован, потому что он был загружен и не создан на моем ПК.

2-й шаг

В cmd я изменил каталог, где находится файл jar.

cd C:fwducky

Затем я набрал dir и увидел, что файл был назван duckencode.jar.jar

Итак, в cmd я изменил исходную команду для ссылки на файл с помощью .jar.jar

java -jar c:fwduckyduckencode.jar.jar -I c:fwduckyHelloWorld.txt  -o c:fwduckyinject.bin

Эта команда, выполненная без сообщений об ошибках, и инь .bin, который я пытался создать, теперь находится в каталоге.

Надеюсь, что это поможет.

Ответ 6

У меня была такая же проблема при попытке запустить файл jar. путь содержал пробел, поэтому мне пришлось размещать кавычки. вместо:

java -jar C:Path to FilemyJar.jar

Мне пришлось писать

java -jar "C:Path to FilemyJar.jar"

Ответ 7

Это сработало для меня
java -jar "filename.jar"

Ответ 8

Это сработало для меня.

cd /path/to/the/jar/

java -jar ./Calculator.jar

Ответ 9

У меня была похожая проблема, и я даже попытался запустить CMD с правами администратора, но это не решило проблему.

Основным является то, что убедитесь, что смените Directory в cmd на текущий каталог, где находится ваш jar файл.

Выполните следующие шаги:

1. Скопируйте файл JAR на рабочий стол.

  1. Запустите CMD

  2. введите команду cd desktp

  3. затем введите java -jar filename.jar

Это должно работать.

Ответ 10

Это также может произойти, если вы не указали правильный список параметров. Вот что я делал:

java -jar [email protected] testing_subject file.txt test_send_emails.jar

Вместо правильной версии:

java -jar test_send_emails.jar [email protected] testing_subject file.txt

Ответ 11

Иногда это происходит, когда вы пытаетесь (запустите или создайте) файл .jar в папке /libs, щелкнув его правой кнопкой мыши в студии android. вы можете выбрать раскрывающееся меню в верхней части андроида и изменить его на приложение. Это будет работать

введите описание изображения здесь

Ответ 12

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

чтобы проверить это, вы можете просмотреть расширенные атрибуты в файле

$ ls [email protected]
[email protected] 1 dave  staff  17663235 13 Oct 11:08 server-0.28.2-java8.jar
com.apple.metadata:kMDItemWhereFroms         619
com.apple.quarantine          68

Затем вы можете очистить атрибуты с помощью

xattr -c file.jar

Ответ 13

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

Ответ 14

Моя особая проблема была вызвана тем, что я работал с каталогами, в которых использовались символические ссылки (ярлыки). Следовательно, попытка java -jar ../../myJar.jar не работала, потому что меня не было, где я думал.

Невзирая на относительные пути к файлу, он исправил его.

Ответ 15

В моем случае предлагаемое имя файла, которое будет использоваться, было jarFile*.jar в командной строке. Файл в папке был jarFile-1.2.3.jar. Поэтому я переименовал файл в jarFile. Затем я использовал jarFile.jar вместо jarFile*.jar, а затем проблема была решена.

Ответ 16

Это может произойти на машине Windows, когда у вас есть пробелы в именах папки. Решение заключалось бы в том, чтобы ввести путь между «».
Например:

java -jar c:my folderx.jar    --> 
java -jar "c:my folderx.jar"

Ответ 17

Чтобы избежать каких-либо проблем с разрешением, попробуйте запустить его как администратор. Это работало для меня на Win10.

Ответ 18

Я знаю, что эта тема существует много лет назад, и проблема тоже была исправлена. Но я надеюсь, что это поможет кому-то еще в будущем, так как я столкнулся с некоторыми похожими проблемами, когда пытался установить Oracle WebLogic 12c и Oracle OFR, в которых его установщик находится в формате .jar. В моем случае это не заключалось в том, что каталог JDK заключался в кавычки, или просто в опечатку.

Запустите Command Prompt от имени администратора и выполните команду в этом формате. Дважды проверьте предложение, если есть опечатка.

"C:Program FilesJavajdk1.xxxxxbinjava" -jar C:UsersxxxDownloadsxxx.jar

Если он показывает что-то вроде JRE 1.xxx is not a valid JDK Java Home, убедитесь, что системные переменные для JAVA_HOME в переменных среды указывают на правильный каталог JDK. Рекомендуется JDK 1.8 или выше (2018).

Полезная ветка здесь, вы можете сослаться на нее: почему она показывает, что ваш JDK c: program filesjavajre7 не является допустимым JDK при установке сервера weblogic?

Ответ 19

У меня была аналогичная проблема, когда TextMate или что-то заменили двойные кавычки двойными кавычками Юникода.

Измените мой SELENIUM_SERVER_JAR из двойных кавычек юникода на обычные двойные кавычки и это решило мою проблему.

Ответ 20

это потому, что вы ищете файл не по пути
1. Найдите путь к папке, в которую вы поместили файл
2. измените каталог cd в cmd, используя правильный путь

Ответ 21

Я использую NetBeans и имею ту же проблему. После того, как я выполнил сборку и очистить проект, моя программа была выполнена. В документации по Java говорится, что команда build/clean предназначена для полного восстановления проекта с нуля и удаления любых прошлых компиляций. Надеюсь, это поможет. Кроме того, я прочитал документацию. В Oracle есть обучающие маршруты NetBeans и Java. Очень полезно. Удачи!

Ответ 22

Возможно, вы указали неправильную версию своей банки.

Ответ 23

если имя apktool, «apktool_2.3.4.jar» или что-то в этом роде. Просто переименуйте его в «apktool.jar»

Ответ 24

Вы пытались запустить его под привилегиями администратора? то есть, запустив команду в «Запуск от имени», а затем выберите администратора с надлежащими учетными данными администратора

работал на меня

Ответ 25

Я пытался это:

После прочтения файла напишите, выполните привилегии:

chmod 777 java-repl.jar

alias jr="java -jar $HOME/Dev/java-repl/java-repl.jar"

Невозможно получить доступ к бла-бла…, это было на Mac OS, хотя

Итак, я попробовал это:

alias jr="cd $HOME/Dev/java-repl/&& java -jar java-repl.jar"

Ответ 26

Это не сработало «Невозможно получить доступ к jarfile»

"C:Program Filesjavajdk-13+33-jrebinjavaw.exe" -jar "C:Program FilesMaxim Integrated Products1-Wire Drivers x64 OneWireViewer.jar"

Это работает

"C:Program Filesjavajdk-13+33-jrebinjavaw.exe" -jar "C:Program FilesMaxim Integrated Products1-Wire Drivers x64OneWireViewer.jar"

Разница заключается в том, что перед OneWireViewer.jar находится один пробел, несмотря на то, что он заключен в кавычки и даже содержит другие пробелы.

Ответ 27

сначала я создал переменную %JAVA_HOME% :

Когда вы загрузили файл, убедитесь, что отметили UNBLOCK TAB в свойствах файла, как показано выше в посте «maartencls».

c:usersmy userdownloadslocation of the fileall> java -jar yourfilename.jar

надеюсь, это решит проблему 🙂

Ответ 28

В моей проблеме для доступа к каталогу из командной строки (в окнах) эта ошибка

«не доступно для доступа…»

потому что неправильное расширение файла

file.jar.jar

!, поэтому измените его, чтобы исправить один

file.jar

🙂 удача

I want to execute my program without using an IDE.
I’ve created a jar file and an exectuable jar file. When
I double click the exe jar file, nothing happens, and when I try to use the command in cmd it gives me this:

Error: Unable to access jarfile <path>

I use the command: java -jar Calculator.jar

How I created the jar:

  1. Right click on project folder (Calculator)
  2. Select
  3. Click on Java Folder and select «Exectuable Jar File», then select next
  4. Launch Configuration: Main — Calculator
  5. Create Export Destination
  6. Hit «Finish» and profit! Well, not really.

Raedwald's user avatar

Raedwald

45.3k39 gold badges148 silver badges234 bronze badges

asked Aug 14, 2012 at 0:01

Joseph Smith's user avatar

Joseph SmithJoseph Smith

3,1335 gold badges19 silver badges18 bronze badges

12

I had encountered this issue when I had run my Jar file as

java -jar TestJar

instead of

java -jar TestJar.jar

Missing the extension .jar also causes this issue.

answered Sep 16, 2014 at 10:26

Vinay Kadalagi's user avatar

Vinay KadalagiVinay Kadalagi

1,2551 gold badge8 silver badges11 bronze badges

3

Fixed

I just placed it in a different folder and it worked.

Paolo Forgia's user avatar

Paolo Forgia

6,4928 gold badges46 silver badges58 bronze badges

answered Aug 15, 2012 at 4:05

Joseph Smith's user avatar

Joseph SmithJoseph Smith

3,1335 gold badges19 silver badges18 bronze badges

8

[Possibly Windows only]

Beware of spaces in the path, even when your jar is in the current working directory. For example, for me this was failing:

java -jar myjar.jar

I was able to fix this by givng the full, quoted path to the jar:

java -jar "%~dp0myjar.jar" 

Credit goes to this answer for setting me on the right path….

Community's user avatar

answered Mar 15, 2016 at 3:15

Robert Brown's user avatar

Robert BrownRobert Brown

10.8k6 gold badges34 silver badges40 bronze badges

2

I had this issue under CygWin in Windows. I have read elsewhere that Java does not understand the CygWin paths (/cygdrive/c/some/dir instead of C:somedir) — so I used a relative path instead: ../../some/dir/sbt-launch.jar.

answered Aug 4, 2016 at 17:18

radumanolescu's user avatar

radumanolescuradumanolescu

3,9691 gold badge27 silver badges41 bronze badges

3

I had the same issue when trying to launch the jar file. The path contained a space, so I had to place quotes around. Instead of:

java -jar C:Path to FilemyJar.jar

i had to write

java -jar "C:Path to FilemyJar.jar"

Dharman's user avatar

Dharman

29.2k21 gold badges79 silver badges131 bronze badges

answered Sep 6, 2015 at 18:05

benez's user avatar

2

Just came across the same problem trying to make a bad USB…

I tried to run this command in admin cmd

java -jar c:fwduckyduckencode.jar -I c:fwduckyHelloWorld.txt  -o c:fwduckyinject.bin

But got this error:

Error: unable to access jarfile c:fwduckyduckencode.jar

Solution

1st step

Right click the jarfile in question. Click properties.
Click the unblock tab in bottom right corner.
The file was blocked, because it was downloaded and not created on my PC.

2nd step

In the cmd I changed the directory to where the jar file is located.

cd C:fwducky

Then I typed dir and saw the file was named duckencode.jar.jar

So in cmd I changed the original command to reference the file with .jar.jar

java -jar c:fwduckyduckencode.jar.jar -I c:fwduckyHelloWorld.txt  -o c:fwduckyinject.bin

That command executed without error messages and the inject.bin I was trying to create was now located in the directory.

Hope this helps.

mcls's user avatar

mcls

8,6932 gold badges28 silver badges28 bronze badges

answered Oct 23, 2015 at 20:26

Leon thomas's user avatar

2

None of the provided answers worked for me on macOS 11 Big Sur. The problem turned out to be that programs require special permission to access the Desktop, Documents, and Downloads folders, and Java breaks both the exception for directly opened files and the permission request popup.

Fixes:

  • Move the .jar into a folder that isn’t (and isn’t under) Documents, Desktop, or Downloads.
  • Manually grant the permission. Go to System Preferences → Security and Privacy → Privacy → Files and Folders → java, and check the appropriate folders.

answered Jan 27, 2021 at 9:50

twhb's user avatar

twhbtwhb

4,1742 gold badges18 silver badges22 bronze badges

I had a similar problem and I even tried running my CMD with administrator rights, but it did not solve the problem.

The basic thing is to make sure to change the Directory in cmd to the current directory where your jar file is.

Do the following steps:

  1. Copy jar file to Desktop.

  2. Run CMD

  3. Type command cd desktop

  4. Then type java -jar filename.jar

This should work.


Edit: From JDK-11 onwards ( JEP 330: Launch Single-File Source-Code Programs )

Since Java 11, java command line tool has been able to run a single-file source-code directly. e.g.

java filename.java

Gabor Dicso's user avatar

answered Dec 26, 2018 at 6:22

Vishwa Ratna's user avatar

Vishwa RatnaVishwa Ratna

5,2555 gold badges32 silver badges54 bronze badges

If you are using OSX, downloaded files are tagged with a security flag that prevents unsigned applications from running.

to check this you can view extended attributes on the file

$ ls -l@
-rw-r--r--@ 1 dave  staff  17663235 13 Oct 11:08 server-0.28.2-java8.jar
com.apple.metadata:kMDItemWhereFroms         619
com.apple.quarantine          68

You can then clear the attributes with

xattr -c file.jar

answered Oct 13, 2017 at 10:24

nick fox's user avatar

nick foxnick fox

5608 silver badges15 bronze badges

1

This worked for me.

cd /path/to/the/jar/

java -jar ./Calculator.jar

answered Nov 15, 2016 at 18:18

Bastian Cáceres Pino's user avatar

It can also happen if you don’t properly supply your list of parameters. Here’s what I was doing:

java -jar test@gmail.com testing_subject file.txt test_send_emails.jar

Instead of the correct version:

java -jar test_send_emails.jar test@gmail.com testing_subject file.txt

answered Jul 15, 2015 at 8:06

Buffalo's user avatar

BuffaloBuffalo

3,7737 gold badges42 silver badges68 bronze badges

For me it happens if you use native Polish chars in foldername that is in the PATH.
So maybe using untypical chars was the reason of the problem.

answered Oct 8, 2015 at 9:52

Huxwell's user avatar

HuxwellHuxwell

1512 silver badges13 bronze badges

sometime it happens when you try to (run or create) a .jar file under /libs folder by right click it in android studio. you can select the dropdown in top of android stuio and change it to app. This will work

enter image description here

answered Feb 17, 2016 at 10:44

anand krish's user avatar

anand krishanand krish

4,0414 gold badges40 silver badges47 bronze badges

My particular issue was caused because I was working with directories that involved symbolic links (shortcuts). Consequently, trying java -jar ../../myJar.jar didn’t work because I wasn’t where I thought I was.

Disregarding relative file paths fixed it right up.

answered Nov 18, 2015 at 23:31

MattSayar's user avatar

MattSayarMattSayar

2,0586 gold badges23 silver badges28 bronze badges

In my case the suggested file name to be used was jarFile*.jar in the command line. The file in the folder was jarFile-1.2.3.jar . So I renamed the file to jarFile. Then I used jarFile.jar instead of jarFile*.jar and then the problem got resolved

answered Jan 22, 2017 at 6:41

suku's user avatar

sukusuku

10.2k15 gold badges73 silver badges117 bronze badges

1

It can happen on a windows machine when you have spaces in the names of the folder. The solution would be to enter the path between » «.
For example:

java -jar c:my folderx.jar    --> 
java -jar "c:my folderx.jar"

Sundar's user avatar

Sundar

4,5406 gold badges35 silver badges60 bronze badges

answered Oct 31, 2017 at 8:57

assaf's user avatar

assafassaf

211 bronze badge

1

To avoid any permission issues, try to run it as administrator. This worked for me on Win10.

answered Mar 14, 2018 at 15:14

Gico's user avatar

GicoGico

1,2362 gold badges15 silver badges30 bronze badges

1

I know this thread is years ago and issue was fixed too. But I hope this would helps someone else in future since I’ve encountered some similar issues while I tried to install Oracle WebLogic 12c and Oracle OFR in which its installer is in .jar format. For mine case, it was either didn’t wrap the JDK directory in quotes or simply typo.

Run Command Prompt as administrator and execute the command in this format. Double check the sentence if there is typo.

"C:Program FilesJavajdk1.xxxxxbinjava" -jar C:UsersxxxDownloadsxxx.jar

If it shows something like JRE 1.xxx is not a valid JDK Java Home, make sure the System variables for JAVA_HOME in Environment Variables is pointing to the correct JDK directory. JDK 1.8 or above is recommended (2018).

A useful thread here, you may refer it: Why its showing your JDK c:program filesjavajre7 is not a valid JDK while instaling weblogic server?

answered Oct 23, 2018 at 6:54

not_Prince's user avatar

not_Princenot_Prince

3201 silver badge17 bronze badges

For me it happen because i run it with default java version (7) and not with compiled java version (8) used to create this jar.

So i used:

%Java8_64%binjava -jar myjar.jar

Instead of java 7 version:

java -jar myjar.jar

answered Feb 9, 2020 at 19:19

Adir D's user avatar

Adir DAdir D

1,13812 silver badges19 bronze badges

I had a similar problem where TextMate or something replaced the double quotes with the unicode double quotes.

Changing my SELENIUM_SERVER_JAR from the unicode double quotes to regular double quotes and that solved my problem.

answered Mar 30, 2016 at 18:05

TankorSmash's user avatar

TankorSmashTankorSmash

11.9k6 gold badges66 silver badges103 bronze badges

this is because you are looking for the file in the wrong path
1. look for the path of the folder where you placed the file
2. change the directory cd in cmd use the right path

answered Jun 19, 2016 at 21:39

felipe's user avatar

0

I use NetBeans and had the same issue. After I ran build and clean project my program was executable. The Java documentation says that the build/clean command is for rebuilding the project from scratch basically and removing any past compiles. I hope this helps. Also, I’d read the documentation. Oracle has NetBeans and Java learning trails. Very helpful. Good luck!

answered Jul 16, 2017 at 13:43

user8315373's user avatar

Maybe you have specified the wrong version of your jar.

answered Sep 21, 2017 at 21:52

cosbor11's user avatar

cosbor11cosbor11

13.5k10 gold badges51 silver badges67 bronze badges

I finally pasted my jar file into the same folder as my JDK so I didn’t have to include the paths. I also had to open the command prompt as an admin.

  1. Right click Command Prompt and «Run as administrator»
  2. Navigate to the directory where you saved your jdk to
  3. In the command prompt type: java.exe -jar <jar file name>.jar

answered Jan 14, 2020 at 15:04

Michaela Burns's user avatar

Keep the file in same directory where you are extracting it. That worked for me.

answered Jan 22, 2020 at 2:18

Aishwary joshi's user avatar

Aishwary joshiAishwary joshi

611 gold badge1 silver badge4 bronze badges

This is permission issue, see if the directory is under your User.
That’s why is working in another folder!

answered Jul 31, 2020 at 13:05

Dimitrios's user avatar

DimitriosDimitrios

1,12311 silver badges10 bronze badges

Rename the jar file and try

Explanation :
yes, I know there are many answers still I want to add one point here which I faced.

I built the jar and I moved it into the server where I deploy (This is the normal process)
here the file name which I moved already existed in the server, here the file will override obviously right. In this case, I faced this issue.
maybe at the time of overriding there can be a permission copy issue.

Hope this will help someone.

answered Aug 3, 2020 at 14:12

Sainath Pabba's user avatar

Have you tried to run it under administrator privoleges?
meaning, running the command in «Run As» and then select administrator with proper admin credentials

worked for me

answered May 14, 2019 at 20:28

Nick_Stubborn_Mex.'s user avatar

I was trying this:

After giving the file read, write, execute priviledges:

chmod 777 java-repl.jar

alias jr="java -jar $HOME/Dev/java-repl/java-repl.jar"

Unable to access bla bla…, this was on Mac OS though

So I tried this:

alias jr="cd $HOME/Dev/java-repl/ && java -jar java-repl.jar"

Litisqe Kumar's user avatar

answered Jul 23, 2019 at 8:53

Kinglee's user avatar

KingleeKinglee

531 silver badge8 bronze badges

This did not work «Unable to access jarfile»

"C:Program Filesjavajdk-13+33-jrebinjavaw.exe" -jar "C:Program FilesMaxim Integrated Products1-Wire Drivers x64 OneWireViewer.jar"

This does work

"C:Program Filesjavajdk-13+33-jrebinjavaw.exe" -jar "C:Program FilesMaxim Integrated Products1-Wire Drivers x64OneWireViewer.jar"

The difference is the single space in front of OneWireViewer.jar not withstanding that it is surrounded with quotes and even has other spaces.

answered Oct 13, 2019 at 15:21

angar's user avatar


Я хочу выполнить свою программу без использования IDE. Я создал JAR-файл и исполняемый JAR-файл. Когда я дважды щелкаю по файлу exe jar, ничего не происходит, и когда я пытаюсь использовать команду в cmd, это дает мне следующее:

Error: Unable to access jarfile <path>

Я использую команду: java -jar Calculator.jar

Как я создал банку:

  1. Щелкните правой кнопкой мыши папку проекта (Калькулятор)
  2. Выбрать
  3. Нажмите на папку Java и выберите «Exableuable Jar File», затем выберите следующий
  4. Конфигурация запуска: Главная — Калькулятор
  5. Создать пункт назначения экспорта
  6. Хит «Готово» и прибыль! Ну не совсем.





Ответы:


Я столкнулся с этой проблемой, когда я запустил файл Jar как

java -jar TestJar

вместо того

java -jar TestJar.jar

Отсутствие расширения .jar также вызывает эту проблему.





Исправлена

Я просто поместил его в другую папку, и это сработало.







[Возможно только для Windows]

Остерегайтесь пробелов в пути, даже когда ваш jar находится в текущем рабочем каталоге. Например, для меня это было неудачно:

java -jar myjar.jar

Я смог исправить это, указав полный путь к банке:

java -jar "%~dp0myjar.jar" 

Кредит идет на этот ответ для установки меня на правильный путь ….




У меня была эта проблема под CygWin в Windows. Я читал в другом месте , что Java не понимает пути Cygwin ( /cygdrive/c/some/dirвместо C:somedir) — так что я использовал относительный путь вместо этого: ../../some/dir/sbt-launch.jar.





У меня была такая же проблема при попытке запустить файл jar. Путь содержал пробел, поэтому я должен был поместить цитаты вокруг. Вместо того:

java -jar C:Path to FilemyJar.jar

я должен был написать

java -jar "C:Path to FilemyJar.jar"




Просто наткнулся на ту же проблему, пытаясь сделать плохой USB …

Я пытался запустить эту команду в админ cmd

java -jar c:fwduckyduckencode.jar -I c:fwduckyHelloWorld.txt  -o c:fwduckyinject.bin

Но получил эту ошибку:

Error: unable to access jarfile c:fwduckyduckencode.jar

Решение

1-й шаг

Щелкните правой кнопкой мыши по указанному файлу. Нажмите свойства. Нажмите на вкладку разблокировки в правом нижнем углу. Файл был заблокирован, потому что он был загружен, а не создан на моем компьютере.

2-й шаг

В cmd я изменил каталог, где находится файл jar.

cd C:fwducky

Затем я набрал dirи увидел, что файл был названduckencode.jar.jar

Таким образом, в cmd я изменил исходную команду для ссылки на файл с .jar.jar

java -jar c:fwduckyduckencode.jar.jar -I c:fwduckyHelloWorld.txt  -o c:fwduckyinject.bin

Эта команда выполнялась без сообщений об ошибках, и файл inject.bin, который я пытался создать, теперь находился в каталоге.

Надеюсь это поможет.



У меня была похожая проблема, и я даже попытался запустить CMD с правами администратора, но это не решило проблему.

Основным является то, что убедитесь, что смените каталог в cmd на текущий каталог где находится ваш jar-файл.

Выполните следующие шаги:

1. Скопируйте файл на рабочий стол.

  1. Запустите CMD

  2. введите команду cd desktp

  3. затем введите java -jar filename.jar

Это должно работать.


Изменить : Начиная с JDK-11 ( JEP 330 : запускать однофайловые программы с исходным кодом)

Начиная с Java 11, инструмент командной строки Java может напрямую запускать исходный код из одного файла. например

java filename.java


Это сработало для меня.

cd /path/to/the/jar/

java -jar ./Calculator.jar


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

чтобы проверить это, вы можете просмотреть расширенные атрибуты в файле

$ ls -l@
-rw-r--r--@ 1 dave  staff  17663235 13 Oct 11:08 server-0.28.2-java8.jar
com.apple.metadata:kMDItemWhereFroms         619
com.apple.quarantine          68

Затем вы можете очистить атрибуты с

xattr -c file.jar



Это также может произойти, если вы неправильно указали свой список параметров. Вот что я делал:

java -jar test@gmail.com testing_subject file.txt test_send_emails.jar

Вместо правильной версии:

java -jar test_send_emails.jar test@gmail.com testing_subject file.txt


иногда это происходит, когда вы пытаетесь (запустить или создать) файл .jar в папке / libs, щелкнув его правой кнопкой мыши в Android Studio. Вы можете выбрать раскрывающийся список в верхней части Android Stuio и изменить его на приложение . Это будет работать

введите описание изображения здесь


Для меня это произойдет, если вы используете родные польские символы в foldername, что в PATH. Так что, возможно, использование нетипичных символов было причиной проблемы.


Моя конкретная проблема была вызвана тем, что я работал с каталогами, которые содержали символические ссылки (ярлыки). Следовательно, попытки java -jar ../../myJar.jarне сработали, потому что я был не там, где я думал.

Независимо от относительных путей к файлам это исправлено.


В моем случае предлагаемое имя файла для использования было jarFile*.jarв командной строке. Файл в папке был jarFile-1.2.3.jar. Поэтому я переименовал файл в jarFile. Затем я использовал jarFile.jarвместо, jarFile*.jarа затем проблема была решена



Это может произойти на компьютере с Windows, если в именах папок есть пробелы. Решением было бы ввести путь между «». Например:

java -jar c:my folderx.jar    --> 
java -jar "c:my folderx.jar"



Чтобы избежать проблем с разрешениями, попробуйте запустить его как администратор. Это работало для меня на Win10.



Я знаю, что эта тема существует много лет назад, и проблема тоже была исправлена. Но я надеюсь, что это поможет кому-то еще в будущем, так как я столкнулся с некоторыми подобными проблемами, когда пытался установить Oracle WebLogic 12c и Oracle OFR, в котором находится его установщик..jar формате. В моем случае это не заключалось в том, что каталог JDK заключался в кавычки, или просто в опечатку.

Запустите Command Promptот имени администратора и выполните команду в этом формате. Дважды проверьте предложение, если есть опечатка.

"C:Program FilesJavajdk1.xxxxxbinjava" -jar C:UsersxxxDownloadsxxx.jar

Если он показывает что-то вроде этого JRE 1.xxx is not a valid JDK Java Home, убедитесь, что системные переменные для JAVA_HOMEв Переменные среды указывают на правильный каталог JDK. Рекомендуется JDK 1.8 или выше (2018).

Здесь вы можете найти полезную ветку : почему JDK c: program files java jre7 не является допустимым JDK при установке сервера weblogic?


У меня была похожая проблема, когда TextMate или что-то заменяло двойные кавычки на Unicode двойные кавычки.

Смена SELENIUM_SERVER_JARдвойных кавычек с юникода на обычные двойные, и это решило мою проблему.


это потому, что вы ищете файл по неправильному пути 1. найдите путь к папке, в которую вы поместили файл 2. измените каталог cd в cmd, используйте правильный путь


Я использую NetBeans и имел ту же проблему. После запуска проекта сборки и очистки моя программа стала исполняемой. В документации Java говорится, что команда build / clean предназначена для перестройки проекта с нуля и удаления всех предыдущих компиляций. Надеюсь, это поможет. Также я прочел документацию. У Oracle есть учебные материалы по NetBeans и Java. Очень полезно. Удачи!


Возможно, вы указали неправильную версию своей банки.


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

  1. Щелкните правой кнопкой мыши командную строку и «Запуск от имени администратора».
  2. Перейдите в каталог, где вы сохранили свой JDK
  3. В командной строке введите: java.exe -jar <jar file name>.jar

Храните файл в том же каталоге, где вы его извлекаете. Это сработало для меня.


Вы пытались запустить его с правами администратора? то есть, запустив команду в «Запуск от имени», а затем выберите администратора с надлежащими учетными данными администратора

работал на меня


Я пытался это:

После прочтения файла напишите, выполните привилегии:

chmod 777 java-repl.jar

alias jr="java -jar $HOME/Dev/java-repl/java-repl.jar"

Невозможно получить доступ к бла-бла …, это было на Mac OS, хотя

Итак, я попробовал это:

alias jr="cd $HOME/Dev/java-repl/ && java -jar java-repl.jar"


Это не сработало «Невозможно получить доступ к jarfile»

"C:Program Filesjavajdk-13+33-jrebinjavaw.exe" -jar "C:Program FilesMaxim Integrated Products1-Wire Drivers x64 OneWireViewer.jar"

Это работает

"C:Program Filesjavajdk-13+33-jrebinjavaw.exe" -jar "C:Program FilesMaxim Integrated Products1-Wire Drivers x64OneWireViewer.jar"

Разница заключается в том, что перед OneWireViewer.jar стоит один пробел, несмотря на то, что он заключен в кавычки и даже содержит другие пробелы.


Для меня это произошло потому, что я запускаю его с версией Java по умолчанию (7), а не с скомпилированной версией Java (8), использованной для создания этого jar.

Так что я использовал:

%Java8_64%binjava -jar myjar.jar

Вместо версии Java 7:

java -jar myjar.jar


Если вы находитесь на WSL, и следуя инструкциям, которые говорят, говорит это:

java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb

На самом деле вам нужно указать полный путь, даже если вы указали его в java.library.pathдетали.

java -Djava.library.path=/mnt/c/dynamodb_local/DynamoDBLocal_lib -jar /mnt/c/dynamodb_local/DynamoDBLocal.jar -sharedDb


Это проблема разрешения, посмотрите, находится ли каталог под вашим пользователем. Вот почему работает в другой папке!


Сначала я создал переменную %JAVA_HOME% :

Когда вы загрузили файл, обязательно проверьте UNBLOCK TABсвойства файла, как показано выше в посте «maartencls».

c:usersmy userdownloadslocation of the fileall> java -jar yourfilename.jar

надеюсь, что это решит проблему 🙂

На чтение 8 мин. Опубликовано 15.12.2019

Я новичок, когда дело доходит до использования Java в Linux. Я клонировал репозиторий, в котором я заинтересован, и я не могу запустить код с моей машины. Команда, которую я пытаюсь сделать:

Ошибка, которую я получаю:

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

Я просмотрел файлы проекта, и на самом деле это не файл с именем example.jar. Есть ли команда, которую я должен запустить сначала, чтобы ее создать?

Заранее благодарим за помощь!

Содержание

  1. 1 ответ
  2. Error: Unable to access jarfile server.jar
  3. Связанные статьи
  4. 27 Answers 27

1 ответ

Да, чтобы запустить банку, она должна существовать.

При его создании вам необходимо сопоставить структуру каталогов с структурой пакета.

Например, ваши каталоги могут быть:

для источников и для файлов классов:

(часто вы найдете классы в ../bin/ .. вместо ../classes/ .. именованная папка или исходные файлы и файлы классов смешиваются в тех же каталогах)

соответствует структуре пакета:

, тогда вы должны перейти в базовый каталог иерархии:

или установите его с параметром -C jar -C /home/ellen/proj/java/foo/example/classes . или из home jar -C proj/java/foo/example/classes . в качестве относительного пути.

Вы создаете файл jar, например:

и проверьте его:

Обратите внимание, что есть файл манифеста, автоматически сгенерированный и полезный, в качестве шаблона, где вы можете добавить информацию о том, что ваш основной класс, если у вас есть такой, но который довольно строгий в отношении синтаксиса (верхний / нижний регистр, разрывы строк).

Такая запись основного класса должна быть добавлена, если вы хотите запустить ее без указания основного класса:

, иначе вы должны использовать:

В сущности, файл jar представляет собой zip-архив и может работать с этими инструментами.

Чистое разделение src / и bin / files полезно, когда у вас более нескольких классов и, возможно, глубокая структура пакетов.

будет тогда, начиная с классов каталога / включать все, что часто вам нужно. (пример / class, example / util / .class, example / net / * class . )

Error: Unable to access jarfile server.jar

Эта ошибка означает что сервер не может получить доступ к исполняемому jar файлу. Вам необходимо переименовать ваш исполняемый jar файл в server.jar (важно: необходимо соблюсти регистр всех букв — должны быть строчными).

Если у вас его вовсе нет файла server.jar следуйте инструкции: https://craftbuy.ru/index.php?rp=/knowledgebase/6/—.html

Error: Invalid or corrupt jarfile server.jar
Error: An unexpected error occurred while trying to open file server.jar

Эти ошибки означают что ваш исполняемый jar файл повреждён, либо что-то другое случилось с файлом. В этом случае загрузите его заново, либо скачайте другой. Некоторые проверенные есть у нас на сайте: https://craftbuy.ru/index.php?rp=/knowledgebase/6/—.html

    894 Пользователи нашли это полезным

Связанные статьи

Если у вас не получается войти в игру и вы видите ошибку указанную в заголовке (или другую.

Следующие рекомендации помогут вам решить проблемы с подключением к серверу:1) Проверьте точность.

I want to execute my program without using an IDE. I’ve created a jar file and an exectuable jar file. When I double click the exe jar file, nothing happens, and when I try to use the command in cmd it gives me this:

I use the command: java -jar Calculator.jar

How I created the jar:

  1. Right click on project folder (Calculator)
  2. Select
  3. Click on Java Folder and select «Exectuable Jar File», then select next
  4. Launch Configuration: Main — Calculator
  5. Create Export Destination
  6. Hit «Finish» and profit! Well, not really.

27 Answers 27

I had encountered this issue when I had run my Jar file as

java -jar TestJar

java -jar TestJar.jar

Missing the extension .jar also causes this issue.

Fixed

I just placed it in a different folder and it worked.

[Possibly Windows only]

Beware of spaces in the path, even when your jar is in the current working directory. For example, for me this was failing:

I was able to fix this by givng the full, quoted path to the jar:

Credit goes to this answer for setting me on the right path.

I had this issue under CygWin in Windows. I have read elsewhere that Java does not understand the CygWin paths ( /cygdrive/c/some/dir instead of C:somedir ) — so I used a relative path instead: ../../some/dir/sbt-launch.jar .

Just came across the same problem trying to make a bad USB.

I tried to run this command in admin cmd

But got this error:

Solution

1st step

Right click the jarfile in question. Click properties. Click the unblock tab in bottom right corner. The file was blocked, because it was downloaded and not created on my PC.

2nd step

In the cmd I changed the directory to where the jar file is located.

Then I typed dir and saw the file was named duckencode.jar.jar

So in cmd I changed the original command to reference the file with .jar.jar

That command executed without error messages and the inject.bin I was trying to create was now located in the directory.

Hope this helps.

i had the same issue when trying to launch the jar file. the path contained a space, so i had to place quotes around. instead of:

This worked for me java -jar «filename.jar»

This worked for me.

I had similar problem and i even tried running my CMD with administrator rights, but it did not solved the problem.

The basic thing is that make sure to change the Directory in cmd to current directory where your jar file is.

Do following steps:

1.Copy jar file to Desktop.

type command cd desktp

then type java -jar filename.jar

This should work.

It can also happen if you don’t properly supply your list of parameters. Here’s what I was doing:

Instead of the correct version:

sometime it happens when you try to (run or create) a .jar file under /libs folder by right click it in android studio. you can select the dropdown in top of android stuio and change it to app. This will work

If you are using OSX, downloaded files are tagged with a security flag that prevents unsigned applications from running.

to check this you can view extended attributes on the file

You can then clear the attributes with

For me it happens if you use native Polish chars in foldername that is in the PATH. So maybe using untypical chars was the reason of the problem.

My particular issue was caused because I was working with directories that involved symbolic links (shortcuts). Consequently, trying java -jar ../../myJar.jar didn’t work because I wasn’t where I thought I was.

Disregarding relative file paths fixed it right up.

In my case the suggested file name to be used was jarFile*.jar in the command line. The file in the folder was jarFile-1.2.3.jar . So I renamed the file to jarFile . Then I used jarFile.jar instead of jarFile*.jar and then the problem got resolved

It can happen on a windows machine when you have spaces in the names of the folder. The solution would be to enter the path between » «. For example:

To avoid any permission issues, try to run it as administrator. This worked for me on Win10.

I know this thread is years ago and issue was fixed too. But I hope this would helps someone else in future since I’ve encountered some similar issues while I tried to install Oracle WebLogic 12c and Oracle OFR in which its installer is in .jar format. For mine case, it was either didn’t wrap the JDK directory in quotes or simply typo.

Run Command Prompt as administrator and execute the command in this format. Double check the sentence if there is typo.

«C:Program FilesJavajdk1.xxxxxinjava» -jar C:UsersxxxDownloadsxxx.jar

If it shows something like JRE 1.xxx is not a valid JDK Java Home , make sure the System variables for JAVA_HOME in Environment Variables is pointing to the correct JDK directory. JDK 1.8 or above is recommended (2018).

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Ошибка u2064 мазда cx9
  • Ошибка u2197 форд фиеста