nus-cs2103-AY2223S2 / forum

12 stars 0 forks source link

Unable to load jar files #284

Closed FredericChow00 closed 1 year ago

FredericChow00 commented 1 year ago

Hi prof,

I am getting this error

Could not save data to file: java.nio.file.AccessDeniedException: C:\WINDOWS\system32\data when I am trying to enter a command for another jar file application that I downloaded.

you know why that may be so?

damithc commented 1 year ago

@FredericChow00 What's the current location of the jar file?

FredericChow00 commented 1 year ago

@damithc i created an empty folder and place the jar file inside it

damithc commented 1 year ago

@FredericChow00 To get the full context, can you share a screenshot of the full terminal, showing the command you used (and the location you are running it from) and the output you got?

FredericChow00 commented 1 year ago

@damithc image

the test2 folder currently resides in my Desktop directory. I used the help command here as an exampe but I am getting this error for every command that I make.

damithc commented 1 year ago

@FredericChow00 Rather than double-click, try running the jar file using the java -jar command (i.e., open a cmd terminal, navigate to the jar location using the cd command, and run java -jar jar_file_name.jar -- this is how you are supposed to run the jar file during the practical exam anyway).

If still doesn't work, please share the where you downloaded the jar file so others can try to reproduce the problem.

FredericChow00 commented 1 year ago

@damithc ah i see ok that solved the issue. thank you!

damithc commented 1 year ago

@FredericChow00 When double-clicking the JAR file in your computer, it seems the JAR file is automatically run in C:\WINDOWS\system32 folder inside which applications don't have permissions to create folders or write files. However, I have not seen such a behavior in my Windows 10 computer, although I think Macs do something similar (i.e., run the JAR file in a location other than the location it is actually in).