Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

The error means Java cannot open the exact file path supplied after -jar. Fix it by checking the jar’s real filename, running the command in the correct folder (or using an absolute path), quoting paths that contain spaces, and correcting read permissions. On a hosting panel, the startup jar setting must match a file that actually exists in the server’s main directory.

What “Unable to access jarfile” means

When you run a command such as java -jar server.jar nogui, Java resolves server.jar as a path. The message Error: Unable to access jarfile server.jar appears when Java cannot open that path. The failure occurs before Minecraft starts, so changing world settings, accepting the EULA, or adjusting gameplay properties will not help yet.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The filename printed in the error is the first clue. Java may be looking in a different directory, the file may have another name or extension, a path may need quotation marks, or the account running Java may not be allowed to read the file. A Minecraft Forum troubleshooting case documented the same issue with java -jar minecraft_server.jar --nogui: the command failed because that exact name was not present in the directory where it was executed (Minecraft Forum, 2023). Playkeeper describes the rule directly: Java prints this error when it cannot open the file specified after -jar (Playkeeper, 2026).

Use this order to diagnose the problem

  1. Identify whether the server is running on your own Windows, Linux, or macOS machine, or inside a hosting control panel.
  2. Open the server’s actual folder and record the jar filename exactly, including capitalization and every extension.
  3. Run the command from that folder, or replace the relative filename with a quoted absolute path.
  4. Check that the account can read the jar and traverse each parent directory.
  5. If Java changes the message to Invalid or corrupt jarfile, stop treating it as a path problem and replace the download.

Do not rename configuration, world, or plugin files while diagnosing. First make the launch command point to the jar that is already present.

Check the real jar filename before changing anything

Make file extensions visible in Windows

Windows Explorer can hide known extensions, making a file that appears to be server.jar actually server.jar.jar. In File Explorer, open View and enable File name extensions (the exact menu arrangement varies by Windows release). Read the complete name shown in the server folder.

  • Look for version suffixes such as paper-1.21.x-123.jar instead of the generic server.jar.
  • Check spelling, punctuation, spaces, and capitalization.
  • Check for a duplicated extension such as server.jar.jar.
  • Make sure you are looking in the folder used by the launch shortcut or script, not merely the folder where the download was saved.

On Linux and macOS, use a terminal listing that shows the literal name:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ls -lb

The -b option makes unusual characters and spaces easier to spot. If the listing shows paper-1.21.1-123.jar, a command naming server.jar cannot open it unless you rename the file or change the command.

Fix a local Windows server

Open Command Prompt in the server directory

The safest approach is to change to the directory containing the jar before launching it. In Command Prompt, use cd /d; the /d switch also changes drives:

cd /d "C:Minecraft Server"
dir /b

dir /b prints the names in that folder. Compare its output with the name after -jar. Once they match, launch the server:

java -Xms2G -Xmx4G -jar server.jar nogui

Replace server.jar with the exact name displayed by dir /b. The memory values in this example are launch options, not a requirement for resolving the access error; use values appropriate for your machine and server.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use an absolute path when the working directory is uncertain

A shortcut, scheduled task, batch file, or terminal opened elsewhere can give Java a different working directory from the one you expect. Bypass that ambiguity by naming the complete path:

java -Xms2G -Xmx4G -jar "C:Minecraft Serverserver.jar" nogui

Keep the quotation marks whenever any directory name contains a space. The same rule applies if the jar itself has spaces in its filename.

Correct a batch file or shortcut

Open the .bat file in a text editor and compare its -jar value with the actual listing. A reliable batch file can explicitly select the server directory:

@echo off
cd /d "C:Minecraft Server"
java -Xms2G -Xmx4G -jar "paper-1.21.1-123.jar" nogui
pause

If you launch through a desktop shortcut, inspect its Target and Start in fields. The target must name the correct jar, and Start in should point to the folder containing it when the command uses a relative filename.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Mattel Games UNO Minecraft Card Game with Storage Tin,Ages 7+ | Video Game Themed Deck with Special Rule for Kids, Teens, Parties & Family Game Night, 2-10 Players (Amazon Exclusive)
  • The classic UNO card game builds fun on game night with a Minecraft theme.
  • UNO Minecraft features a deck and storage tin decorated with graphics from the popular video game.
  • Players match colors and numbers to the card on top of the discard pile as in the classic game.
  • The Creeper card unique to this deck forces other players to draw 3 cards.
  • Makes a great gift for kid, teen, adult and family game nights with 2 to 10 players ages 7 years and older, especially Minecraft and video game fans.

Fix a local Linux or macOS server

Confirm the current directory and its contents

Relative paths are resolved from the directory shown by pwd, not from the location of your terminal window’s last download. Run:

pwd
ls -lb

Change to the server directory, quoting it if its path contains spaces:

cd "/home/minecraft/Minecraft Server"
ls -lb

Then launch the exact filename:

java -Xms2G -Xmx4G -jar server.jar nogui

Linux filenames are case-sensitive. Server.jar, server.jar, and server.JAR are different names. macOS normally uses a case-insensitive file system, but scripts and mounted volumes can still expose case differences, so matching the listing exactly is the portable habit.

Quote or escape spaces

These two forms are equivalent when the directory contains a space:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
java -jar "/home/minecraft/Minecraft Server/server.jar" nogui
java -jar /home/minecraft/Minecraft Server/server.jar nogui

Without quoting or escaping, the shell splits the path at the space and Java receives an incomplete filename.

Rank #4
Mattel Games UNO Minecraft Card Game for Kids, Adults, Families & Parties, Deck & Special Rule Inspired by the Video Game, 2 to 10 Players
  • Now Minecraft lovers can play a special version of UNO!
  • Same as Basic UNO but features Minecraft characters and includes special Creeper rule card. Draw this card and the other players have to draw three more cards from the pile!
  • The goal is to get rid of all the cards in your hand.
  • First player or team to 500 wins.
  • When you're down to one card, don't forget to yell "UNO"!

Check read and directory permissions

Inspect the jar and its parent directory:

ls -l server.jar
ls -ld . ..

The account that starts Minecraft needs read permission on the jar and execute (traverse) permission on every parent directory. If a different service account launches the server, test as that account rather than as an administrator. Correct ownership or permissions according to your operating system’s policy; do not make the jar world-writable merely to suppress an error. A permission failure can look like a missing file because Java is unable to open the path even though a directory listing shows it.

Match the command to the filename instead of guessing

Server software downloads often include a version and build number. A command copied from an older tutorial may still say minecraft_server.jar while the folder contains a newer, versioned file. Either change the command to the present name or deliberately rename the jar to the stable name used by your script.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
What you see Why Java fails What to change
paper-1.21.1-123.jar in the folder; command uses server.jar The relative path names a file that does not exist. Use -jar paper-1.21.1-123.jar, or rename the file and update any scripts consistently.
Explorer displays server.jar; extensions reveal server.jar.jar The visible label hid an extra extension. Rename it to the intended single-extension filename or use the complete name.
Jar is in C:Minecraft Server; command runs from another folder Java resolves server.jar relative to the current directory. Use cd /d first or supply the quoted absolute path.
Directory name contains a space The shell splits an unquoted path into separate arguments. Put quotation marks around the complete path, or escape spaces on Unix-like systems.
File is visible to an administrator but not the service account The launching account lacks read or parent-directory traversal permission. Adjust ownership or permissions, then retry as the account that actually runs the server.

Correct a hosting-panel startup command

In a managed server panel, you usually do not control the terminal’s working directory. The panel starts Java with a configured startup command or jar variable. Open the server’s Startup, Variables, or similarly named settings page and compare the configured jar value with the filename shown in the panel’s main server directory.

Typical panel mismatch

If the startup field says server.jar but the directory contains paper-1.21.1-123.jar, Java receives a name that does not exist. Change the field to the real filename, including capitalization and extension. Do not add a path from your personal computer; the panel needs the name or path used inside its own server container.

After an upload or software change

Recheck the startup setting whenever you upload a new build, switch server software, or remove an old jar. A panel may leave the previous filename in place after an update. Stop the server before renaming or replacing the jar, save the startup setting, and start it again so the panel uses the new value.

Protect worlds and configuration before reinstalling

Some panels offer a reinstall function that can overwrite server files. Back up the world directories, server.properties, whitelist and operator files, plugins, and other configuration before using it. Reinstallation is not the first response to an access error; it is a recovery option after preserving data and confirming that the startup value is correct. Omne Hosting also distinguishes a missing or misnamed jar from an Invalid or corrupt jarfile condition and advises replacing a bad download (Omne Hosting, 2026).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Distinguish a missing jar from a corrupt jar

These messages indicate different failures:

Message Meaning Action
Unable to access jarfile <name> Java cannot open the path represented by <name>. The usual causes are location, spelling, quoting, or permissions. Inspect the listing, working directory, absolute path, and access rights.
Invalid or corrupt jarfile <name> Java found and opened the file, but its contents are not a valid readable jar. Delete the damaged download and obtain a fresh server jar from the relevant official software source.

Do not “fix” a corrupt jar by changing only the filename. If a fresh copy produces the access error, return to the path and permission checks; replacing the file can change one symptom while leaving the launch command wrong.

Useful checks when the obvious fix did not work

Verify which Java command is being used

Once the path is correct, confirm that Java is available to the same account and environment that launches the server:

java -version

This check does not repair a missing jar, but it separates a path problem from a Java installation or service-environment problem. If a panel supplies its own Java runtime, use the panel’s documented runtime selection rather than assuming the Java installed on your personal computer is relevant.

Check for a moved, quarantined, or partially uploaded file

If the directory listing no longer shows the jar, locate the copy you intended to use. Antivirus quarantine, an interrupted upload, or extracting files into an unexpected subfolder can leave the launch script unchanged while removing the expected path. In a panel, refresh the file manager after uploading and verify that the file appears in the panel’s primary server directory, not only in a temporary upload area.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read the complete error line

Copy the filename exactly as Java prints it. The text after jarfile may reveal a typo, an omitted directory, or a missing quote. Do not correct only the displayed message; correct the command or startup variable that generated it.

Common mistakes to avoid

  • Running from the download folder once and from another folder later: a relative command succeeds only when its current directory contains the jar.
  • Keeping a tutorial’s generic name forever: versioned server builds rarely retain the same filename across updates.
  • Relying on Explorer’s shortened display: hidden extensions can conceal .jar.jar.
  • Adding quotation marks around only part of a path: quote the entire path, including the filename.
  • Changing permissions blindly: grant the launching account the access it needs instead of making files broadly writable.
  • Reinstalling before backing up: panel reinstall tools may overwrite worlds and configuration.
  • Treating every Java error as the same: “unable to access” points to opening the path; “invalid or corrupt” points to the file’s contents.

A short recovery checklist

  1. Open the folder or panel directory that is supposed to contain the server jar.
  2. Record the complete filename, including extension, capitalization, version, and build number.
  3. Compare that name character-for-character with the value after -jar or in the panel’s startup jar field.
  4. Run locally from the jar’s directory, or use a quoted absolute path.
  5. For Linux or macOS, confirm read permission on the jar and traverse permission on parent directories; for Windows, ensure the launching account can access the folder.
  6. Retry and note the new message.
  7. If it now says Invalid or corrupt jarfile, replace the download from the appropriate official source.
  8. Before any panel reinstall, back up worlds, configurations, plugins, and access-control files.

When managed hosting is the better option

If you repeatedly lose track of local paths, service accounts, or startup variables, managed Minecraft server hosting can remove much of that operating-system maintenance. It does not make filename mismatches impossible: the panel still needs a startup jar value that points to an existing file. Choose this route for a control panel that exposes the file manager and startup setting clearly, provides backups, and documents how uploads and software changes affect the launch command.

Final takeaway

Java is not searching for a Minecraft server by type; it is opening one exact path. Make the name after -jar identical to a real jar in the command’s working directory, quote any path containing spaces, and give the launching account access to the file and its parent directories. In a hosting panel, make the startup jar variable match the file in the panel’s main directory. Only the separate Invalid or corrupt jarfile message calls for replacing the jar itself.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.