Java error opening jar file

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 ...

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.4k39 gold badges149 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 badge28 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.3k21 gold badges80 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,7132 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,2042 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,2635 gold badges32 silver badges55 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

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,7837 gold badges43 silver badges68 bronze badges

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

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,1014 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,0686 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 badges74 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,15012 silver badges20 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

12k6 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 badges52 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

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.4k39 gold badges149 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 badge28 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.3k21 gold badges80 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,7132 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,2042 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,2635 gold badges32 silver badges55 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

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,7837 gold badges43 silver badges68 bronze badges

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

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,1014 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,0686 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 badges74 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,15012 silver badges20 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

12k6 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 badges52 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

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.

Unable to access jarfile error message on Windows

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.

Jarfile Examples.

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.

  1. In your computer’s search menu, type in “Control Panel”.
  2. In the control panel window, choose “uninstall a program” under programs.
Image of Windows 10 control panel and the uninstall a program option.
  1. 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.
  2. Take a look at the version number and see if it matches the latest release.
  3. If it doesn’t, uninstall the program by right-clicking on it.
Image of how to uninstall Java and see the version number in the uninstall program function on Windows 10.
  1. Choose “yes” when prompted.
  2. From the official Java website, download the latest version.
  3. 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.

  1. In your computer’s taskbar, open File Explorer.
  2. Find the folder that contains your JAR package.
  3. Right-click on the folder and choose “open,” and then Java.
  4. If Java is not listed, select “choose another app”.
Use Java to open your Jarfile package.
  1. 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.
  2. Browse your computer for Java and find the program. Select it and hit the “open” option.
  3. A prompt window may open. If it does, choose “okay” and “open”.
  4. 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.

  1. Press the Windows key and “I” on your keyboard to open Settings. Alternatively, type “settings” into your computer’s search menu.
  2. Click into the “apps” option in the Settings window.
Apps in Settings Window on Windows 10
  1. Choose “default apps” in the left-hand sidebar.
  2. Scroll until you see, “choose default apps by file type” and click it.
  3. Now, look for .jar in the list and click on “Choose a default” next to it.
  4. Find the Java Platform Program (Java Run-Time Environment) on your computer.
  5. Save the changes and exit.
Windows 10 Settings - Apps, Set Java as a Default Program to Use

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.

  1. In your computer’s taskbar, open File Explorer.
  2. At the top of the window, click on the “View tab”.
Click View - Then Options.
  1. Now click on the “Options” button to the far right.
  2. In the new window that opens, click on the “View tab” again.
  3. In the list, choose the “Show hidden files, folders, and drives” option.
  4. Hit Apply and then hit OK.
Checkmark the Show Hidden Files, Folders, and Drives Option.

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.

What Jarfix looks like.

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!

  • Partition Wizard

  • Partition Magic

  • How to Fix Jar File Not Opening? – Here are 5 Solutions

By Ariel | Follow |
Last Updated March 11, 2021

A great many people complain that the Jar file won’t open. Have you come across the Jar file not opening on Windows 10? Now, you come to the right place. This post of MiniTool summarizes several tested solutions.

Fix 1. Reinstall Java

The first and simplest troubleshooting method for Jar file not opening is to reinstall Java Runtime Environment. To do so, follow the steps below:

Step 1. Right-click the Start menu and select Apps and Features from the context menu.

select Apps and Features

Step 2. Navigate to Java from the list of installed programs and click on Uninstall. Then follow the on-screen prompts to complete the uninstallation.

Step 3. Click here to open the download page of Java and save it to your computer.

Step 4. Open the Java installation folder, and then right-click the install wizard and select Run as administrator.

Step 5. Then press the Install button to start installing. Once the Java is installed, check if the Jar file won’t open.

Fix 2. Set Java.exe as a Default for the .Jar Files

In addition, you can manually select Java as a default app to open the .Jar files. Some people have proven that this solution can fix the Jar file not opening Windows 10 issue. Let’s have a try:

Step 1. Right-click the .Jar file and select Open with.

Step 2. You will see a list of suggested applications and click on More apps at the bottom.

Step 3. Scroll down to the bottom and click on Look for another app on this PC link.

Look for another app on this PC

Step 4. In the File Explorer, navigate to the Java.exe file via the Programs FilesJaveJave versionBin path.

Step 5. Select the Java application and click on the Open button to set it as the default app fro .Jar files.

Now, you can reopen the program and see if the Jar file won’t open.

Fix 3. Create a .bat File

Some users reported that .Jar file not opening can be fixed by creating a .bat file and using it each time you want to open a specific Jar file. Here’s how to do that:

Step 1. Navigate to the .Jar file and create a new Notepad file in the same folder. To do so, right-click the empty space in the folder and select New > Text Document.

select New and Text Document

Step 2. Open the Notepad, and then enter the java -jar filename.jar line in it and click on File > Save as. Replace the filename.jar with the actual name of the Jar file.

click on File and Save as

Step 3. Select the Save as type to All files, and then type the desired name for the Jar file and add .bat as an extension in the File Name box. After that, click on Save. Now, you can double click the .bat file and check if Jar file won’t open.

Note: You need to repeat the above steps for every Jar file and make sure you save the .bat file in the same location as your Jar file.

Fix 4. Run Command Prompt

Another tested solution is to access the Jar file via Command Prompt. If the .Jar file won’t open, you can run certain commands to open it. For that:

Step 1. Type cmd in the search bar, and then right-click the Command Prompt app and select Run as administrator from the context menu.

Step 2. In the elevated Command Prompt window, type the following commands one by one and hit Enter after each one. Also, you can enter the actual path of the .Jar file next to java –jar.

Note: Moving your jar file to the root directory can access the file faster. If you don’t want to move the file, you need to run the cd command to locate the root directory of the Jar file.

  • cd
  • java -jar filename.jar (Replace the jar with the actual name of the Jar file.)

access Jar file via command prompt

Now, you can restart the computer and check to see if the .Jar file not opening issue still persists.

Fix 5. Check the File Name Extension Is Correct

In some cases, the Jar file not opening Windows 10 can be caused by an incorrect file extension. Here’s how to check it:

Step 1. Press Win + E keys to open the File Explorer, and navigate to the problematic Jar file.

Step 2. Go to the View tab and select the checkbox for File name extensions.

Step 3. Check if the Jar file has a .jar extension at the end. If not, you can change the extension to .jar and save it. After that, you can try opening it and see if the Jar files not opening problem has been resolved.

check the box for File name extensions

Note: If the issue still persists, you should check your browser. If the browser downloads the file improperly, then it can trigger the problem. To fix it, you can try using a different browser and download it again.

About The Author

Ariel

Position: Columnist

Ariel is an enthusiastic IT columnist focusing on partition management, data recovery, and Windows issues. She has helped users fix various problems like PS4 corrupted disk, unexpected store exception error, the green screen of death error, etc. If you are searching for methods to optimize your storage device and restore lost data from different storage devices, then Ariel can provide reliable solutions for these issues. 

Java ARchive, aka JAR files, are famous ZIP formats with which you can bundle multiple files into a single folder.

However, it will baffle your mind when you can’t access your desired jarfile. This error can appear when the jars are corrupt or the manifest entries are missing. But as a Java programmer, let me tell you about six simple fixes that will surely solve your issue.

unable-toaccess-jarfile

So without bouncing any parts, let’s resolve the jar file access error together.

What Causes the Error: Unable to Access Jarfile?

Malware and outdated Java versions can cause the inability to access jar file errors. Additionally, you can face this issue if Java is not your default jar file launcher. Plus, this access error will appear when the executed jar file path is incorrect.

Don’t you worry. All the possible reasons are stated below so that you can find out which is responsible for your error and fix that immediately.

Here are the causes of the jar file access error:

  • Your system may have malware.
  • Your system doesn’t have the updated version of Java installed in it.
  • The default program for getting access to the Jar files isn’t set.
  • The file path for the executable java files is incorrect.
  • Your specific Jar file is not available in the Jar folder.
  • Invalid Jar value entry.
  • The jar file is corrupt.

Now you know what causes the error, let’s move into the fixing section without further ado. But if you are wondering about Java’s importance, read about why java is necessary

After you face the unable to access error while opening a jar file, you must update Java to its latest version to fix the issue. Several users claim that removing malware, setting up Java as the default launcher, and ensuring the correct file path can solve the error.

I displayed all of the above methods below for your aid. Follow through and resolve your issue.

Here are the steps to fix the error of being unable to access the jar file:

1. Update Java to the Latest Version

As I discussed before, not having the latest version of Java may lead to the error of not getting access to the jar file. So, you need to make sure that you install the newest version of java in your system. If you don’t have it, download it from the official website and install it.

Here are the steps to update JAVA:

Check whether the error persists or not.

However, if popup messages for updates bother you after installing Java on your system, fix the irritating issue by preventing the java update popup.

2. Detect Malware

Having malware in your system is always an issue to be worried about, and you can see the error message resulting from existing malware in your computer.

In that particular scenario, you must check for any existing virus or malware in your system using the Windows Defender or any other antivirus you are using.

When the malicious malware, virus, or bugs are removed from your PC, Update the Java using the previous method. Then you will be free from the irritating jarfile access error.

Additionally, suppose you are using Internet Explorer to browse the internet, and it stops working due to a javascript failure. At that crucial moment fixing the IE javascript will give you a smooth experience again. But for now, let’s see the following procedure to resolve the error.

3. Set Java as Default Opening Program

You should set Java as the default file handler or program to access the JAR files. This operation can also terminate the error and help you to run jar files.

Here are the steps to set Java as the default opening program:

Now try to open the jar file, and you will not meet any difficulties.

Furthermore, if you are a Discord user and suddenly fall into a Javascript error, then you must fix that Javascript error on Discord.

4. Make Hidden Files and Folders Visible

Well, this is a rare case, but sometimes this hidden feature of windows can be the reason behind the error message.

Here’s the procedure to make the hidden files visible on Windows 10:

However, if you are operating Windows 11, navigate to File Explorer > View > Show > Hidden items to complete the same method.windows-view-show-hidden-items

Additionally, creating invisible folders can enhance your privacy when you are a Windows 11 user.

5. Open the Jarfile with Java

Often some simple workaround can cure your error; the same can be said about the jar file access error. Let’s find out together how to conclude that operation.

Here are the steps to launch the jarfile with the Java program:

  • Right-click on the jarfile and choose the Open with option.
  • Select Java if you find it on the list; otherwise, click on Choose another app.windows-choose-another-app-option
  • Pick the Java program from there.
  • Select OK when prompted.

The jar file will run on another window, and your error will vanish.

6. Use a Third Party App

jar-fix-exe

If none of the above methods works for you, then this is the option for you to run jar files. You have to look for JarFix on the internet and download it. Then click on jarfix.exe after you install it and fix the JAR file error.

To operate the app, right-click on the error jarfile and choose Open with, then select JarFix to launch the file, and you’ll be good to go.

TIP: Make sure that the file is selected to be opened by Java.

Nonetheless, with Eclipse IDE’s aid, you can swiftly program in Java, and the installation process of Eclipse on Windows 11 is also straightforward. And when you don’t need the program anymore, you can uninstall the app easily.

Final Thoughts

So, these are some of the solutions that I have tried before to solve the error and was quite successful, to be very honest.

You can try these solutions without any hesitation as it would solve your problem within no time.

If you still face any problem then, do let me know in the comments.

  • MiniTool

  • MiniTool News Center

  • 4 Useful Methods to Fix the “Unable to Access Jarfile” Error

By Daisy | Follow |
Last Updated March 05, 2021

google search

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

  1. Install the Latest Java Version
  2. Set the Default File Association
  3. Check for Malware
  4. 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.

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

Daisy

Position: Columnist

She was graduated from the major in English. She has been the MiniTool editor since she was graduated from university. She specializes in writing articles about backing up data & systems, cloning disks, and syncing files, etc. She is also good at writing articles about computer knowledge and computer issues. In daily life, she likes running and going to the amusement park with friends to play some exciting items.

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. They are built on the ZIP architecture and have a .jar extension.

Unable to access Jarfile

Unable to access Jarfile

Users experience the error “Unable to access Jarfile” when they either try to open a .JAR package or an application prompts them when it fails to launch. This error message is very common and signifies that you do not have handlers for .JAR set correctly.

What causes the error ‘Unable to access Jarfile’?

There are several different reasons why you might experience this error message but most of them are related to the handling of .JAR files on your computer. The reasons for this error are but not limited to:

  • You do not have the latest JAVA version installed on your computer. For the efficient running of JAR files, it is necessary that you have the required latest framework installed on your computer.
  • The default program for opening JAR files is not set.
  • Malware is present on your computer which might be interfering with the entire process.
  • The file path set for the Java executable is not correct and points to a wrong location. This might cause the error message whenever you boot your computer.

Before moving on with the solutions, make sure that you have an active internet connection and administrator account privileges.

Solution 1: Installing Latest Java Update

Like mentioned before, for programs to run JAR files, the proper architecture i.e. Java needs to be installed on your computer. Furthermore, it should be the latest version released for the users. If you don’t have Java installed, you can directly download and install it. If you have an older version, we will first uninstall it and then install the latest one from the official website.

  1. Press Windows + R, type “appwiz.cpl” in the dialogue box and press Enter.
  2. Once in the application manager, search for the entry of Java. Right-click it and select Uninstall.

Uninstalling old Java

Uninstalling old Java – application manager
  1. Once the application is uninstalled, navigate to the official Java website and download the latest one. After downloading the executable, run it to install the latest version of Java.
  2. Restart your computer and check if the error message has been resolved.

Solution 2: Setting the default file association

You might also experience the error message is Java is not set as the default handler for JAR files on your computer. An archiving program might be selected as the default opener of JAR files which might not produce the result which you were expecting. We can try changing the file association and check if this fixes the problem.

  1. Navigate to the directory where the JAR file is located. Right-click it and select Open with and select the Java program.

Opening JAR files with Java

Opening JAR files with Java
  1. If you do not get the option right away to open as Java, you can click Choose another app and from the list, select Java.
  2. If you want to set the default association permanently in your computer for JAR files to be opened by Java, we can do that in the settings.

Press Windows + I to launch the settings. Now navigate to Apps and select Default apps from the left navigation bar.

  1. Now click Choose default apps by file type present at the near bottom. Now locate the entry .jar files and make sure it is selected to be opened by Java.

Changing Default File Association

Changing Default File Association
  1. Save changes and exit. Restart your computer and check if the error message is resolved.

Solution 3: Checking for malware

If you are still getting the error when you start your operating system or any program, you should check if your computer contains any virus or malware. These entities exploit your registry and after modifying several keys, makes jar file unusable.

Scanning using MalwareBytes

Scanning using Malware Bytes

You should run a thorough check on your computer and then follow Solution 1 to make sure all the entries and file associations are deleted and then remade when we reinstall Java. You check our article on How to remove malware using Malwarebytes.

Solution 4: Checking for documentation (for Developers)

Developers also experience this error message when they try to launch JAR files when they are coding with Java or some other language. This can be really troublesome and will probably halt your task at hand.

Java coding error

Java coding error

To diagnose and solve the error, it is recommended that you read the documentation of the function or utility which you are using to open or run JAR files. You might have gotten the file path wrong or maybe passing incorrect parameters to the function. You can easily get demos of the functionality which you are trying to implement in popular coding websites such as Stack Overflow. Identify your mistake and fix it before running the program/function again.

If none of the methods shown above have fixed your problem it’s possible that you are trying to open is corrupted or it needs to be repaired. There are some programs that you can use to repair this file. However, we personally recommend you to use JarFix as it is freeware and you won’t have to pay anything.

Photo of Kevin Arrows

Kevin Arrows

Kevin is a dynamic and self-motivated information technology professional, with a Thorough knowledge of all facets pertaining to network infrastructure design, implementation and administration. Superior record of delivering simultaneous large-scale mission critical projects on time and under budget.

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

  • How to Get to Advanced System Settings on Windows 10
  • Windows 10 Undoing Changes Made to Your Computer [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

Содержание

  1. Как исправить ошибку «Невозможно получить доступ к jarfile» в Windows 10
  2. Как исправить ошибку «Невозможно получить доступ к jarfile» в Windows 10
  3. Как я могу избавиться от Unable to access jarfile error на Windows 10?
  4. 1. Добавьте самую последнюю версию Java в Windows
  5. 2. Выберите Java в качестве программы по умолчанию для файлов JAR.
  6. 3. Выберите параметр Показать скрытые файлы, папки и диски.
  7. 4. Откройте программное обеспечение Jarfix
  8. Unable to Access JarFile: 3 Ways to Run JAR Files
  9. Changing the default app for JAR files should fix this issue
  10. Why does it say unable to access jar?
  11. How can I fix the unable to access JarFile error?
  12. 1. Update your Java version
  13. 2. Select Java as the default program for JarFiles
  14. 3. Open the Jarfix Software
  15. [Solved] How to Fix Java Virtual Machine Launcher Error
  16. 4 Solutions to Solve Java Virtual Machine Launcher Error
  17. Remove Malware on your computer
  18. Uninstalling Java and re-installing
  19. Clearing Computer Memory
  20. Miscellaneous Fix
  21. Conclusion

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

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

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

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

Как я могу избавиться от Unable to access jarfile error на Windows 10?

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

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

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

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

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

Ничего не происходит, когда вы нажимаете на Запуск от имени администратора? Не волнуйтесь, у нас есть правильное решение для вас.

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

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

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

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

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

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

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

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

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

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

Jarfix — это легковесная программа, предназначенная для исправления не запускающихся программ Java. Программа исправляет ассоциации типов файлов JAR.

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

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

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

СВЯЗАННЫЕ ИСТОРИИ, ЧТОБЫ ПРОВЕРИТЬ:

Источник

Unable to Access JarFile: 3 Ways to Run JAR Files

Changing the default app for JAR files should fix this issue

  • 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.

  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.
  2. Right-click the Java app and select the Uninstall option.
  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.
  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.
  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

3. Open the Jarfix Software

  1. Click jarfix.exe on this webpage to save the software to a folder.
  2. Now, open the folder and double-click the jarfix.exe option.
  3. 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.

Still having issues? Fix them with this tool:

Источник

[Solved] How to Fix Java Virtual Machine Launcher Error

The virtual machine or processor inside your computer that provides an environment for all the Java programs to run on your computer is the Java Virtual Machine. It is a set of specifications of an abstract machine that loads the file containing the programming, interprets it and also helps it being executed it.

Thus the JVM takes the byte code of the program, which is stored in a ‘.class.’ Format and converts it into the operating system specific code, which the machine can read and hence can be run on your computer. So without the proper functioning of this virtual machine on our computers, the many Java-based applications will not be running on our computers!

But that is precisely what happens very often (while booting the computer or opening a java based application) and we get an error called the Java Virtual Machine Launcher Error. In this article, we will be talking about the standard Java Virtual Machine Launcher errors, the kind of error messages that will come up when you are having a particular problem and how to go about solving these problems.

4 Solutions to Solve Java Virtual Machine Launcher Error

Remove Malware on your computer

If the error message is shown is this- “Error Message: Java Virtual Machine Launcher could not find the main class: the program will now exit” then the Microsoft Malicious Software Removal tool, which is an inbuilt utility tool in Microsoft can be used to remove any Malware from your computer.

To access this tool, go to the Search Windows option in your Start menu and type “mrt” and press Enter. In The tool, choose the option for “Full Scan” and follow the on-screen wizard to start the scan. The scan may take a few moments to complete and in the process will also remove all the Spyware, Adware and Malware on your computer. Reboot your computer once the scan is complete.

Now using the System Configuration tool on your computer the rest of the problem. To launch this, you need to type “msconfig” in the Search Windows option that you can find in the Start Menu. In this utility tool, click the “Startup” tab, which opens a long list. Scan the list to find the following- “WJView.exe” and “javaw.exe.” and uncheck these options.

Uninstalling Java and re-installing

As the heading suggests, this solution involves uninstalling the problematic Java Virtual Machine launcher from your computer and then installing it afresh. This is a quite primitive but effective solution to Java Virtual Machine launching problems when the error message shows- “Error Message: Error opening registry key.”

Before uninstallation, open the Windowssystem32 and delete the following files- ‘javaws.exe’, ‘java.exe’, ‘javaw.exe’ and any other Java executable file that you can find. For uninstalling JVM, open the ‘Programs and Features’ tab in the Control Panel of your desktop. Scroll down the list to find Java runtime and uninstall it.

For re-installing Java runtime, visit java.com: Java + You and download the most compatible version. Choosing the correct version is very important as an incompatible version of Java Runtime is one of the biggest reasons for the error.

Clearing Computer Memory

One of the most frequent reasons for the Java Virtual Machine launcher problems is insufficient memory in your COMPUTER. This insufficiency may be in your overall computer memory or in the amount of memory you allocate to Java Runtime. To solve the former, just get rid of all those programs that you don’t use, and you will have a clutter-free (and hopefully a problem-less) computer.

When Java has allocates insufficient memory space, then the error that comes is- “Error Message: Could not create the Java Virtual Machine.” This is one of the most common Java Virtual Machine Launcher errors that you encounter during playing games on Java like Minecraft.

To solve the memory space allocated to Java, go to the Systems options in Control Panel and open the Advanced options window. Here, clicking on the Environment Variables option, you will find a ‘System Variables’ option. Click on the ‘New’ variable option and put the name of the variable as ‘_JAVA_OPTIONS’ with a value of ‘Xmx512M’. (Xmx refers to the maximum space and Xms refer to the minimum space that you can allocate to Java)

Miscellaneous Fix

This solution is for the Java Virtual Machine Launcher error prompt- “Error Message: Unable to access jarfile.” Which comes when trying to open some java based applications. Start by opening the ‘Default Programs’ tab from the Start Menu. Scan the list to find an option called- ‘Associate a file type or protocol with a program’ and select it.

There will be an extension ‘.jar’- Click on this and change the default program to ‘JAVA virtual machine launcher’. Clicking on ‘Close’ will save the changes. Try reopening the program that was earlier causing the problem.

Conclusion

Hopefully, by following this article, you will solve the Java Virtual Machine Launcher error, and all your Java-based applications and games will be up and running smoothly again. There is also this hack if you want to assess your Java skills! All suggestions regarding alternative methods to resolve the launcher error are welcome.

Источник

If you cannot open .JAR JAVA files on a Windows 10, 8 or 7 based computer, with error «Unable to install Java. There are errors in the following switches: filename.jar. Check that the commands are valid and try again«, continue reading below. 

The error «There are errors in the following switches» while trying to open a JAVA .JAR file usually occurs because of multiple installed versions of Java on the PC, or because the the .jar association has been hijacked.

FIX: "There are errors in the following switches" in Java .jar file

This tutorial contains instructions to fix the following Java error while trying to open a .jar file:

«Java Installation Not Completed.
Unable to install Java. There are error in the following switches: ‘C:Users…file.jar’;.
Check that the commands are valid and try again.»

  • Related article: Java Installation Not Completed – Unable to install Java in JAVA JNLP files.

How to FIX: Unable to Open Java JAR Files – There are errors in the following switches: ‘file.jar’.

Method 1. Uninstall and re-Install JAVA on your system.

The first step, to resolve problems with JAVA, is to uninstall all installed versions of Java and to re-install the correct and most recent version of JAVA on your PC. To do that:

1. Download and run the Java Uninstall tool.
2. Choose Agree at the first screen. *

* Note: If prompted that «There is only one up-to-date Java version detected. Are you sure to continue?» click Yes.

Java Uninstall tool

3. Select all the installed Java versions and click Next.

image_thumb[37]

4. Click Yes again to clean the cache

image_thumb[43]

5. When the uninstall is completed, click the Get Java button or navigate to Java Download page to download and install the latest Java version. *

* Note: If you use 32-bit and 64-bit browsers, you will need to install both 32-bit and 64-bit Java in order to have the Java plug-in for both browsers. You can download both Java versions from here.

image_thumb[44]

6. After installing Java on your system, try to open the JAR file again and if you still face the same error, apply the instructions at method-2 below.

Method 2. Set «Java Platform SE Binary» as the Default program to Open .JAR files.

1. Right-click on the .jar file and choose Open with… -> Choose another app

Cannot Open Java JAR files - Unable to Install Java

2. Check Always use this app to open .jar files and click More apps.

image

3. Scroll down and click Look for another app in this PC.

FIX: Unable to open java files

4. Now navigate to the folder where JAVA is installed.

  • For 64-bit versions of Java navigate to C:Program FilesJavajre_versionbin
  • For 32-bit versions of Java navigate to C:Program Files(x86)Javajre_versionbin

5. Select the «javaw.exe» application (Java Platform SE Binary) and click Open.

image

6. Now, the jar file should open without problem, but If you still face the sane error, follow the instructions on method-3 below.

Method 3. Repair Invalid Java files Association with Jarfix.

1. Download the Jarfix.exe tool from here.
2. Double-click to run the Jarfix tool to restore the .jar file association.

Fix Java JAR file association

That’s all folks! Did it work for you?
Please leave a comment in the comment section below or even better: like and share this blog post in the social networks to help spread the word about this solution.

If this article was useful for you, please consider supporting us by making a donation. Even $1 can a make a huge difference for us.

Понравилась статья? Поделить с друзьями:
  • Java application error log
  • Java application error illegalargumentexception
  • Java 1603 error windows 7
  • Java 105 error
  • Java 102 error