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
- 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.
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:
How we test, review and rate?
We have worked for the past 6 months on building a new review system on how we produce content. Using it, we have subsequently redone most of our articles to provide actual hands-on expertise on the guides we made.
For more details you can read how we test, review, and rate at WindowsReport.
- 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
- Press the Windows key + R, type appwiz.cpl, and click OK.
- Right-click the Java app and select the Uninstall option.
- 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
- Open File Explorer and the folder that includes your JAR file.
- Right-click the file and select Open with, and then Choose another app.
- Select Java if it’s listed among the default programs.
- If Java isn’t listed among the programs, select the Look for another app on this PC option.
- 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.
- Fix: This Alias Cannot be Added to Your Account Error on Windows 11
- How to fix the Thinkpad if it Won’t Wake Up
- Microsoft Store Apps vs Desktop Apps: Which Ones to Use?
- Fix: Control Panel is Not Showing All Programs on Windows 11
- Fix: ATA/SATA Hard Drive not Detected in BIOS
3. Open the Jarfix Software
- Click jarfix.exe on this webpage to save the software to a folder.
- Now, open the folder and double-click the jarfix.exe option.
- The tool will start and fix issues with your jar file extension.
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.
If you have recently tried to open a JAR package file, only to receive the error, “unable to access Jarfile,” this simply means that your computer either doesn’t have the right software to open the file, or you have the wrong file path. Other common reasons for getting this error is if you have an outdated version of Java, your computer is infected with malware, or the default program for opening your JAR files isn’t set correctly. Before we jump into the solutions for this, let’s take a look at what JAR is.
Understanding JAR Package Files
Java Archive or JAR is a package file format based on ZIP architecture. It is used to group together multiple Java class files, their metadata, and any resources these files need to run into one single package. The purpose of doing this is to then distribute the grouped files as needed for the running of applications and programs. In order to run the executable file in a JAR package, you must have the latest Java Run-Time Environment installed.
If you are getting the error, “unable to access Jarfile” it means that you are encountering one of the following problems:
- Your system has malware that is either preventing the Jarfile package to open.
- The Jarfile package is corrupted from malware.
- You do not have the latest Java Run-Time Environment installed.
- The default program for accessing JAR files isn’t set.
- The file path for the executable Jarfile package is incorrect.
The “unable to access Jarfile” error is quite a common one since there are many popular programs that use Java as their programming language. For instance, Netflix uses it along with Python for applications in its back-end, while Spotify uses it to stabilize data transfer, and Minecraft uses it for its launcher. Other popular programs and services that use Java include: Uber, Amazon, LinkedIn, Google, and Android OS.
1. Update Your Java to the Latest Version
The most likely reason that you are getting the, “unable to access Jarfile” error is due to an outdated version of Java. Unfortunately, outdated versions of Java Run-Time Environment are prone to security risks and loopholes, so keeping it updated is highly recommended regardless of whether you are getting the above error.
- In your computer’s search menu, type in “Control Panel”.
- In the control panel window, choose “uninstall a program” under programs.
- In the list of programs, scroll until you see Java. Or use the search program box in the top right-hand corner of the window.
- Take a look at the version number and see if it matches the latest release.
- If it doesn’t, uninstall the program by right-clicking on it.
- Choose “yes” when prompted.
- From the official Java website, download the latest version.
- Once downloaded, use the setup wizard to install Java.
Now, re-try opening your JAR package to see if the problem is fixed.
2. Make Java the Default Program for Opening JAR Packages
If you are still getting the “unable to access Jarfile” error after updating your Java Run-Time Environment to the latest version, then you may not have Java set as the default program to use for opening JAR packages.
- In your computer’s taskbar, open File Explorer.
- Find the folder that contains your JAR package.
- Right-click on the folder and choose “open,” and then Java.
- If Java is not listed, select “choose another app”.
- In the window that pops up, choose Java from the list. If it is not there, choose the “look for another app on this PC” option.
- Browse your computer for Java and find the program. Select it and hit the “open” option.
- A prompt window may open. If it does, choose “okay” and “open”.
- Double-click on your JAR package executable to open.
When browsing for Java on your computer in step 6, the most common place for it to be is in Program Files (x86)/Java/Java <Version>/Bin/Java.exe. Keep in mind that Java is usually installed to the default hard drive disk where your operating system is, unless you do a custom installation path. So, keep this in mind when trying to find Java on your computer.
3. Set Java as a Default Association Permanently
If you use a lot of programs or applications that use the Java Run-Time Environment, it is recommended that you set Java as a default association permanently in your computer, so that any JAR packages or files are automatically opened by Java.
- Press the Windows key and “I” on your keyboard to open Settings. Alternatively, type “settings” into your computer’s search menu.
- Click into the “apps” option in the Settings window.
- Choose “default apps” in the left-hand sidebar.
- Scroll until you see, “choose default apps by file type” and click it.
- Now, look for .jar in the list and click on “Choose a default” next to it.
- Find the Java Platform Program (Java Run-Time Environment) on your computer.
- Save the changes and exit.
Now restart your computer for the changes to take effect and see if you can open your JAR package without the, “unable to access Jarfile” error.
4. Check for Malware to Eliminate Infections Causing Trouble
If you are still getting the “unable to access Jarfile” error, it may be from malicious malware. A virus can easily exploit your registry and modify it to make JAR packages unusable. It is highly recommended that you run a thorough scan of your entire computer to look for malware. If you find some, remove it and uninstall Java. Repeat fix 1 in this list to reinstall.
5. Configure Hidden Files/Folders/Drives to Show
While not as common, sometimes hidden files, folders, and drives can cause the “unable to access Jarfile” error.
- In your computer’s taskbar, open File Explorer.
- At the top of the window, click on the “View tab”.
- Now click on the “Options” button to the far right.
- In the new window that opens, click on the “View tab” again.
- In the list, choose the “Show hidden files, folders, and drives” option.
- Hit Apply and then hit OK.
6. Repair Your Java Programs with Jarfix.
If you are using programs that launch with Java and they are not responding to you, no matter how many times you try to open the application, then it may be time to repair your JAR associations. To do this, simply download Jarfix, a lightweight program that fixes hijacked JAR associations, and run it.
7. Check the Documentation If You Are a Developer
If you are working in Java as a developer and come across the “unable to access Jarfile” error, it is likely that there is a minor mistake within the coding. It is recommended that you go back through and re-read to make sure that you have the right file path and the correct parameters for the code to work. Depending on what utility you are using to open and run your JAR packages, you may need to go back through and re-read the documentation on how to get it functioning properly.
Wrapping It Up
In most cases, the “unable to access Jarfile ” error will be solved by updating your Java Run-Time Environment to the latest version, but if it doesn’t solve the problem, please do try out the other methods on this list. Let us know in the comments below if we were able to help you!
You are here: Home/ Software/ Java Unable To Access Jarfile On Windows 10 – How To Fix?
Some users have recently reported an error while running some applications, where they get the error message ‘Unable to access jarfile’. Here I shall discuss how you can easily solve this error on your devices. Check here to know how to uninstall java deployment toolkit.
JAR is the extension given to the package file format that Java class files use to pack metadata and resources into a single package file for distribution. When the application running the Java class files is unable to locate or process the jarfile, you will see this error message.
Usually, you can get this error message due to the following reasons:
- Outdated java application
- Incorrect location of the Java executable file
- Malware
- Default application not set for the JAR file format.
How To Fix ‘Unable To Access Jarfile’ Error Message?
Now that you know why you may be facing the unable to access jarfile in Minecraft and other applications, here are some simple solutions that you can apply to solve this error.
Solution 1: Check For Malware
Let us start by making sure that your system is up to date with the latest security measures. A regular security check is mandatory if you handle sensitive information on your computer. A virus or malware can compromise your data and put your privacy at risk.
Scan your device for viruses and malware. If you have premium third-party antivirus software, use them to scan for any hidden malware or other potential risks. Else, you can also choose from a host of free antivirus applications like Avast antivirus or Malwarebytes free anti-malware.
Solution 2: Change The Open With Option
Some users have reported that after a recent update to their Windows, the default app associated with the .JAR file format changed to some other apps installed on their device. This can also be one of the reasons that you see the Unable to access error for the .jar files on your computer.
This can be easily solved, as all you need to do is change the default app associated with the file using the right-click context menu. Here are the simple steps that you need to follow:
- First, navigate to the directory where you have saved the .JAR package using file explorer.
- Right-click on the .jar package to reveal the context menu.
- Hover over Open with > to reveal additional settings.
- Here you should see your Java application on the list.
Click on it to open the file with your java application.
If you wish to permanently change the application associated with jar file packages to the Java app installed on your computer, follow these steps:
- Right-click again on the .JAR file to reveal the context menu.
- Click on Properties from the menu.
- Under the General tab, click on the Change… button next to the Opens with section.
- This will open another dialog box listing all the applications that are installed on your computer.
- Make sure that the checkbox next to Always use this app to open .jar files is checked.
- Select your Java application from this list to bind it to the.jar file format permanently.
- Save the changes and restart your computer.
Now check if changing the default file association solved the error for you.
Solution 3: Check The Documentation For Wrong File Paths
If you are a developer facing this problem while running JAR files, you might have some additional work to do in order to solve this issue. This error is really troublesome, as you will need to crosscheck the app code that is presenting you the error.
To find out what is causing this error, you need to read the utility documentation provided of the package that shows you the error. There is a chance that there is an incorrect parameter pointing to some invalid location. If the file path is wrong, there is a chance that you may be presented with this error.
You can use coding websites like Stack Overflow to produce a demo of the function that you are trying to run. Scrub through the code to identify the problem and fix it to solve the error.
Solution 4: Update Or Reinstall The Java Application
If the solutions above failed to help solve your jarfile error, the problem might be with the java app itself. If you are not running the latest version of the Java platform, there is a chance that the .JAR package will fail to recognize the java app completely.
Update your java application. Although Java updates are usually installed automatically, sometimes you may have to manually update the app in order to solve the errors associated with the app.
If updating the app did not help you, you will need to reinstall the application completely for java to run properly. You can uninstall the application from either the control panel or use a third-party batch uninstaller (like the ones from this list) to remove residual files as well.
Next, visit the Java website. Download the latest version of the Java application on your computer and install the same.
With the latest version installed, check if the error persists. The unable to access jarfile error should now be resolved.
Solution 5: Use Jarfix To Solve Java Errors
Jarfix is a free repair utility that is used to fix problems with the java-archive. If you see java unable to access jarfile error on your computer, you can use this freeware to restore the full functionality of the java app.
Simply download the Jarfix app from this website. When you double click on the app, the .jar extension will be restored to open with the correct application.
Once the process finishes, check if the error persists. Your error should be solved.
Wrapping Up
So, there you have it. Now you know how to solve the Unable to access jarfile error message using one or a combination of the solutions provided above. Comment below if you found this useful, and to discuss further the same.
-
Home
-
News
- 4 Useful Methods to Fix the “Unable to Access Jarfile” Error
By Daisy | Follow |
Last Updated
A JAR is a package file format which is used by many Java class files with the associated metadata and resources to get packed in a single package for distribution. Sometimes, the “unable to access jarfile” error will occur when you open it. You can read this post from MiniTool to fix this error.
What Causes the “Unable to Access Jarfile” Error
There are several different reasons for the “Java unable to Access Jarfile” issue. Most of them are related to the handling of JAR files on your computer.
1. The latest Java version has not been installed on your computer.
2. The file path set for the Java executable is incorrect and points to the wrong location.
3. The default program for opening JAR files is not set.
4. Malware is on your computer.
Tip: You should ensure that you have an active internet connection and administrator account privileges before you move on to the methods.
How to Fix the “Unable to Access Jarfile” Error
- Install the Latest Java Version
- Set the Default File Association
- Check for Malware
- Check for Documentation (for Developers)
How to Fix the “Unable to Access Jarfile” Error
Method 1: Install the Latest Java Version
You need to install the proper architecture i.e. Java on your computer for programs to run JAR files. Furthermore, it should be the latest version released. Here is the tutorial.
Step 1: Press the Windows + R keys at the same time to open the Run dialogue box, then type appwiz.cpl and click OK to open the Programs and Features window.
Step 2: Then navigate to the entry of Java and right-click it, then click Uninstall.
Step 3: Then go to the official Java website and download the latest version. Run it to install the latest version of Java after you download the executable.
Restart your computer and check if the “Unable to Access Jarfile” error message has been resolved.
Method 2: Set the Default File Association
If you are still unable to access jarfile Minecraft, you can try changing the file association. Here are the steps.
Step 1: Navigate to the JAR file’s directory. Right-click it and select Open with and select the Java program.
Tip: If you do not get the option right away to open as Java, you can click Choose another app and select Java.
Step 2: Then press the Windows + I keys to launch the Settings application. Now navigate to Apps and select Default apps from the left navigation bar.
Step 3: Now click Choose default apps by file type present at the near bottom. Now locate the entry .jar file and make sure it is selected to be opened by Java.
Step 4: Then you should save changes and exit.
Restart your computer and check if the “unable to access jarfile” error message is resolved.
Method 3: Check for Malware
You should check if there is any virus or malware on your computer if you are still receiving the error when you start your operating system or any program.
You should run a thorough check on your computer and then follow method 1 to ensure all the entries and file associations are deleted and then remade when you reinstall Java. Here is how to remove malware after you check, read this post – How To Remove Malware From A Windows Laptop.
Method 4: Check for Documentation (for Developers)
If you are a developer coding with Java or other languages, you also encounter this error message when you try to start a JAR file. This can be really troublesome and will probably halt your task at hand.
It is recommended that you read the documentation for the function or utility that opens or runs the JAR file to diagnose and solve the error. You may have mistaken the file path, or you may have passed the wrong parameter to the function.
Final Words
You can know the reasons for the “Java unable to Access Jarfile” issue and 4 useful methods that can fix the error from this post. I really hope that this post can help you.
About The Author
Position: Columnist
Having been an editor at MiniTool since graduating college as an English major, Daisy specializes in writing about data backups, disk cloning, and file syncing as well as general computer knowledge and issues. In her free time, Daisy enjoys running and going with friends to the amusement park.
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:
- Right click on project folder (Calculator)
- Select
- Click on Java Folder and select «Exectuable Jar File», then select next
- Launch Configuration: Main — Calculator
- Create Export Destination
- Hit «Finish» and profit! Well, not really.
Raedwald
46.8k44 gold badges151 silver badges238 bronze badges
asked Aug 14, 2012 at 0:01
Joseph SmithJoseph Smith
3,2635 gold badges20 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 KadalagiVinay Kadalagi
1,3351 gold badge8 silver badges11 bronze badges
4
Fixed
I just placed it in a different folder and it worked.
Paolo Forgia
6,6028 gold badges47 silver badges58 bronze badges
answered Aug 15, 2012 at 4:05
Joseph SmithJoseph Smith
3,2635 gold badges20 silver badges18 bronze badges
9
[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 "%~dp0\myjar.jar"
Credit goes to this answer for setting me on the right path….
answered Mar 15, 2016 at 3:15
Robert BrownRobert Brown
10.9k7 gold badges35 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:\some\dir
) — so I used a relative path instead: ../../some/dir/sbt-launch.jar
.
answered Aug 4, 2016 at 17:18
radumanolescuradumanolescu
4,0692 gold badges31 silver badges45 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 File\myJar.jar
i had to write
java -jar "C:\Path to File\myJar.jar"
Dharman♦
31.1k25 gold badges87 silver badges138 bronze badges
answered Sep 6, 2015 at 18:05
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:\fw\ducky\duckencode.jar -I c:\fw\ducky\HelloWorld.txt -o c:\fw\ducky\inject.bin
But got this error:
Error: unable to access jarfile c:\fw\ducky\duckencode.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:\fw\ducky\
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:\fw\ducky\duckencode.jar.jar -I c:\fw\ducky\HelloWorld.txt -o c:\fw\ducky\inject.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
9,1412 gold badges29 silver badges28 bronze badges
answered Oct 23, 2015 at 20:26
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
twhbtwhb
4,3142 gold badges20 silver badges23 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 foxnick fox
5708 silver badges15 bronze badges
1
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:
-
Copy jar file to Desktop.
-
Run CMD
-
Type command
cd desktop
-
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
answered Dec 26, 2018 at 6:22
Vishwa RatnaVishwa Ratna
5,6175 gold badges33 silver badges56 bronze badges
It can also happen if you don’t properly supply your list of parameters. Here’s what I was doing:
java -jar [email protected] testing_subject file.txt test_send_emails.jar
Instead of the correct version:
java -jar test_send_emails.jar [email protected] testing_subject file.txt
answered Jul 15, 2015 at 8:06
BuffaloBuffalo
3,8618 gold badges44 silver badges69 bronze badges
This worked for me.
cd /path/to/the/jar/
java -jar ./Calculator.jar
answered Nov 15, 2016 at 18:18
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
HuxwellHuxwell
1712 silver badges14 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
answered Feb 17, 2016 at 10:44
anand krishanand krish
4,2954 gold badges44 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
MattSayarMattSayar
2,0786 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
sukusuku
10.5k16 gold badges75 silver badges120 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 folder\x.jar -->
java -jar "c:\my folder\x.jar"
Sundar
4,5906 gold badges37 silver badges61 bronze badges
answered Oct 31, 2017 at 8:57
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
GicoGico
1,2762 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 Files\Java\jdk1.xxxxx\bin\java" -jar C:\Users\xxx\Downloads\xxx.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 files\java\jre7 is not a valid JDK while instaling weblogic server?
answered Oct 23, 2018 at 6:54
not_Princenot_Prince
3203 silver badges17 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%\bin\java -jar myjar.jar
Instead of java 7 version:
java -jar myjar.jar
answered Feb 9, 2020 at 19:19
Adir DayanAdir Dayan
1,33813 silver badges21 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
TankorSmashTankorSmash
12.2k6 gold badges68 silver badges106 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
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
Maybe you have specified the wrong version of your jar.
answered Sep 21, 2017 at 21:52
cosbor11cosbor11
14.8k10 gold badges54 silver badges70 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.
- Right click Command Prompt and «Run as administrator»
- Navigate to the directory where you saved your jdk to
- In the command prompt type:
java.exe -jar <jar file name>.jar
answered Jan 14, 2020 at 15:04
Keep the file in same directory where you are extracting it. That worked for me.
answered Jan 22, 2020 at 2:18
Aishwary joshiAishwary joshi
711 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
DimitriosDimitrios
1,16311 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
If you are on WSL (Windows Subsystem for Linux), and following a guide which say, says this:
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
You actually need to specify the full path, even though you’ve provided it in the java.library.path
part.
java -Djava.library.path=/mnt/c/dynamodb_local/DynamoDBLocal_lib -jar /mnt/c/dynamodb_local/DynamoDBLocal.jar -sharedDb
answered Apr 21, 2020 at 14:10
AncientSwordRageAncientSwordRage
7,17619 gold badges90 silver badges175 bronze badges
2
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
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"
answered Jul 23, 2019 at 8:53
KingleeKinglee
531 silver badge8 bronze badges