What are Exit Codes in Linux?
An exit code or exit status tells us about the status of the last executed command. Whether the command was completed successfully or ended with an error. This is obtained after the command terminates.
The basic ideology is that programs return the exit code 0 to indicate that it executed successfully without issues. Code 1 or anything other than 0 is considered unsuccessful.
There are many more exit codes other than 0 and 1, which I’ll cover in this article.
Various exit codes in Linux shell
Let us take a quick look at the prominent exit codes in the Linux shell:
| Exit code | Meaning of the code |
|---|---|
| 0 | Command executed with no errors |
| 1 | Code for generic errors |
| 2 | Incorrect command (or argument) usage |
| 126 | Permission denied (or) unable to execute |
| 127 | Command not found, or PATH error |
| 128+n | Command terminated externally by passing signals, or it encountered a fatal error |
| 130 | Termination by Ctrl+C or SIGINT (termination code 2 or keyboard interrupt) |
| 143 | Termination by SIGTERM (default termination) |
| 255/* | Exit code exceeded the range 0-255, hence wrapped up |
The termination signals like 130 (SIGINT or ^C ) and 143 (SIGTERM) are prominent, which are just 128+n signals with n standing for the termination code.
Now that you are briefly familiar with the exit codes let’s see about their usage.
Retrieving the exit code
The exit code of the previously executed command is stored in the special variable $? . You can retrieve the exit status by running:
This will be used in all our demonstrations to retrieve the exit code.
Note that the exit command supports carrying the same exit code of the previous command executed.
Exit code 0
Exit code 0 means that the command is executed without errors. This is ideally the best case for the completion of commands.
For example, let us run a basic command like this
Exit code 0 (successful execution)
This exit code 0 means that the particular command was executed successfully, nothing more or less. Let us demonstrate some more examples.
You may try killing a process; it will also return the code 0 .
Killing an application (same shell) results in code 0
Viewing a file’s contents will also return an exit code 0, which implies only that the ‘cat’ command executed successfully.
Exit code 1
Exit code 1 is also a common one. It generally means the command terminated with a generic error.
For example, using the package manager without sudo permissions results in code 1. In Arch Linux, if I try this:
It will give me exist code as 1 meaning the last command resulted in error.

Exit status 1 (impermissible operation)
If you try this in Ubuntu-based distros ( apt update without sudo), you get 100 as an error code for running ‘apt’ without permissions. This is not a standardized error code, but one specific to apt.
While this is a general understanding, we can also interpret this as «operation impermissible».
Operations like dividing by zero also result in code 1.

Division by zero
Exit code 2
This exit code is given out when the command executed has a syntax error. Misusing the arguments of commands also results in this error.
It generally suggests that the command could not execute due to incorrect usage.
For example, I added two hyphens to an option that’s supposed to have one hyphen. Code 2 was given out.

Invalid argument results in code 2
When permission is denied, like accessing the /root folder, you get error code 2.

Permission denied
Exit code 126
126 is a peculiar exit code since it is used to indicate a command or script was not executed due to a permission error.
This error can be found when you try executing a shell script without giving execution permissions.
Exit code 126 due to insufficient permissions
Note that this exit code appears only for the ‘execution‘ of scripts/commands without sufficient permissions, which is different from a generic Permission Denied error.
So, on’t confuse it with the previous example you saw with exit code 2. There, ls command ran and the permission issue came with the directory it was trying to execute. Here, the permission issues came from the script itself.
Exit code 127
This is another common one. Exit code 127 refers to «command not found». It usually occurs when there’s a typo in the command executed or the required executable is not in the $PATH variable.
For example, I often see this error when I try executing a script without its path.

Script executed without the path gives «command not found»
Or when the executable file you’re trying to run, is not listed in the $PATH variable. You can rectify this by adding the parent directory to the PATH variable.
Abhishek Prakash It’s FOSS

You’ll also get this exit code when you type commands that do not exist.

Unmount is not a command, and Screenfetch is not installed
Exit code series 128+n
When an application or command is terminated or its execution fails due to a fatal error, the adjacent code to 128 is produced (128+n), where n is the signal number.
This includes all types of termination codes, like SIGTERM , SIGKILL , etc that apply to the value ‘n’ here.
Code 130 or SIGINT
SIGINT or Signal for Keyboard Interrupt is induced by interrupting the process by termination signal 2, or by Ctrl+C.
Since the termination signal is 2, we get a code 130 (128+2). Here’s a video demonstrating the interrupt signal for lxappearance .
5 Ways to Fix Minecraft Exit Code 1 Error

Minecraft has been around for over a decade now, with its customer base continuing to expand monthly. The game records an estimated 140 million monthly unique players, the largest of any video game in the world. This record is amazing for players like you who strive to improve in achievements as you play.
However, the pros of being part of such a large community come with cons too. The large user base of the video game makes the developers sometimes struggle to maintain the website. As a player, you may experience some difficulties, such as the exit code 1 error . When this error pops up on your screen, you can fix it by following the solutions we have provided in this guide.
We also have guides on fixing other problems, such as the exit code 0 and server connection timed-out errors.
Table of Contents
What does the Minecraft Exit Code 1 Mean?
When you receive the error code Game Ended with Bad State: Exit Code 1, it means that there is a problem with either Java, your Minecraft configuration, or your PC. To fix it, you have to edit the Java Executable Path, correct the Minecraft launcher path, reinstall Java, disable mods, or update your graphics card driver.
5 Ways to Fix the Exit Code 1 Error
1. Change the Java Executable Path
In most instances, when you receive the code 1 error , the problem is with the working directory of Java. More specifically, the problem is caused by a single character in the Java path used by Minecraft.
To fix this, you have to edit the Java executable path in Minecraft’s settings:
- First, open the Minecraft launcher on your PC and click on LaunchOptions.
- Next, turn on the Java executable toggle.
- You can now edit the Java executable path. The original path shows the Java filename as javaw.exe and this is where the problem lies. You have to remove the ‘w’ character from the Java path such that it becomes java.exe. Here’s an example (only change the Java name as shown below, don’t change the entire path):
- Old: C:\Program Files (x86)\Minecraft\runtime\jre-x64\1.8.0 25\bin\ javaw.exe
- New: C:\Program Files (x86)\Minecraft\runtime\jre-x64\1.8.0 25\bin\java.exe
Relaunch the game and that should fix the problem. If it hasn’t, you can move on to other solutions explained in this guide.
2. Fix the Minecraft Launcher Path
If you’re playing Minecraft on Windows, one of the causes of the issue is when the Windows account username contains special characters, such as an exclamation mark or a hashtag.
If that is the case, you should change the Minecraft launcher path on your PC to a path that does not have a special character. Here is how to go about it:
- Close Minecraft.
- Right-click on the Minecraft shortcut on your desktop and select Properties .
- If there’s no shortcut on your desktop, then go to the installation directory of Minecraft, right-click on Minecraft.exe, and create a shortcut.
3. Reinstall Java
If, after trying the two fixes above, the problem persists, you can go ahead and remove all versions of Java from your computer entirely, including old versions, and then reinstall it.
- Search for and open Apps & Features.
- From the list, find Java. Right-click on it and select Uninstall .
- Once you have successfully uninstalled Java, go to this page to download the latest version of Java and install it.
- Check to see if you can start playing Minecraft without getting an exit code 1 error.
4. Disable Mods
Mods make playing Minecraft fun, but if they develop a problem, it affects your game and can cause problems such as the one that you’re facing now . Also, whenever Minecraft releases a new version, some mods become incompatible with the new version.
To know if your mods are the problem, you should try disabling any mod you may have installed on your computer. You can also remove it totally, to be sure. If you do not want to go to such an extent, you can check the error logs to see if a particular mod is causing the problem. Here is how to check the error logs for unstable mods:
- Open the Run dialog by pressing the Windows + R keys.
- Type %AppData% and click on Enter.
- Open the .minecraft folder.
- Click on the logs folder.
- Open the file titled latest.txt .
- Look over the log files carefully to see if there is any problem with any mod. If there is any such mod, remove it from Minecraft.
5. Update Graphics Card Drivers
The reason Minecraft is displaying an error may be because your graphics card driver is outdated. So what you have to do is update the graphics card driver to the latest version available. You can do this by following the simple steps explained below:
- Open the Run dialog by pressing the Windows + R keys.
- Next, type dxdiag in the box and press Enter.
- Go to the Display tab to see the graphics card driver information. There, you will see the version of the card driver you are using.
- Go to the website of the driver manufacturer and look for the latest version available. If yours is not the same, you should download the latest version and install it on your PC.
Open Minecraft and see if the error has been fixed.
Wrapping Up
When you receive an error in Minecraft stating that the “Game ended with bad state (exit code 1)” , you do not need to panic. What you should do, instead, is go through each of the solutions provided in this guide and see which works for the problem.
Решение ошибки: «Не запустился Minecraft и вызвана Консоль разработчика» в TLauncher

К некоторым ошибкам при запуске игры, лаунчер НЕ может подобрать решение, поэтому вызывается «Консоль разработчика», для ручного поиска проблемы. В данной статье будут даны рекомендации по работе с данной консолью.
Minecraft closed with exit code:

После того, как игра не запустится и покажется консоль, в конце данной консоли можно найти указанный выше текст. Обычно, после двоеточия, указывается специальный код ошибки, по нему можно поискать решение.
Список кодов с ссылками на их решения:
Бывает множество ТАКИХ КОДОВ, если в нашем списке нет такого кода, то используйте поисковую систему (Яндекс или Google) с примерно таким запросом «Minecraft closed with exit code: НОМЕР КОДА ИЗ КОНСОЛИ», возможно на форумах или на каких-либо сайтах есть решение.
Minecraft closed with exit code: -1 или 1
Самая частая проблема с таким кодом, из-за модов. Обычно в логах можно опознать какой мод вызвал ошибку, но если это вызывает у вас затруднение, пробуйте следующее решения:
1) Полностью удалите все моды и устанавливайте по 1-3 моду, если работает, добавляйте еще по немного модов. Так, вы найдете тот, который вызывает краш.
2) Для модов, мы рекомендуем использовать нашу систему мод-паков, подробнее о ней можно узнать на отдельной странице.
3) Если вылетает такой код даже без модов, то попробуйте «Полный сброс» в настройках TLauncher (иконка «Шестерёнки» -> «Настройки» -> Вкладка «Настройки TLauncher» -> кнопка «Полный сброс».).
Java Error: Problematic frame

Если вы наблюдаете в конце консоли подобный текст (возможно такого и не будет, тогда переходим дальше), где есть надписи «A fatal error has been detected by the Java Runtime Environment:», то необходимо найти «Problematic frame».
На следующей строке находим ***.dll , в котором и происходит ошибка (например, ig4dev32.dll), используйте наши гайды для решения проблемы:
Если гайда у нас по ошибке нет, можно искать в поисковой системе, примерно с таким текстом: «***.dll error minecraft», где *** название после problematic frame (например, ig4dev32.dll).
Изучите нашу справку, для получение дополнительной информации по ошибкам игры и лаунчера.
Полный текст ошибки:
Minecraft был аварийно закрыт по причине неизвестной ошибки. Для определения причин ошибки была вызвана Консоль разработчика.
Пишите в комментариях какой способ помог, а так же если нечего не помогло, свяжитесь с нами: [email protected]
How to Fix Minecraft Error 1
Nothing is more disappointing than trying to launch Minecraft, only to be presented with an error. Since it’s one of the most common error codes, let’s check out how to fix Minecraft error 1.
What Kind of Error Is Exit Code 1?

Game Crashed: Exit Code 1
Minecraft error 1, also known as exit code 1, simply means that the game couldn’t boot up. While this is very vague, 3 key aspects are usually at fault: your Minecraft settings, Java, or your PC.
How to Fix Minecraft Error 1
As with most Minecraft errors, you should start by doing the following:
- Restart the Minecraft Launcher.
- Reboot your computer.
If these didn’t fix Minecraft error 1, you need to get into more advanced troubleshooting. Thankfully, we’ve narrowed down the solutions to just 4!
Disable Minecraft Mods
At first, you’ll have to check out if one of your Minecraft mods is preventing it from working. This is often an issue after an update since some mods are initially incompatible with the newer version.
To spot the mod that’s creating the issue, you’ll have to navigate to the logs:
- Press the Windows+R key, type “%AppData%” on the Run window, and press Enter.
- Navigate to the “.minecraft” folder.
- Click on logs → latest.log (or latest.txt)
Update Your Graphics Card Drivers
As with error 502, you’ll need to first update your GPU’s drivers. If you don’t have your card’s manufacturer program installed, you can find the drivers online:
Change the Java Executable Path

Changing the Java Executable Path on the Minecraft Launcher
If you’ve not managed to fix Minecraft error 1 yet, the issue might be Java-related. Exit code 1 often occurs when the Minecraft Launcher executes “javaw.exe” instead of “java.exe”.
To change the Java executable path, you’ll need to:
- Launch the Minecraft Launcher and navigate to “Installations”.
- Hover over the version you’re playing on, click on the 3 dots, and select “Edit”.
- At the bottom of the page, select “More Options”.
- Click on “Browse” under Java Executable.
- Select “java.exe” on the Minecraft Launcher folder (Minecraft Launcher\runtime\java-runtime-gamma\windows-x64\java-runtime-gamma\bin)
Reinstall Java

Uninstalling Java through the Control Panel on Windows
In case the above fix doesn’t work, you should reinstall Java. You can either do that by downloading Java’s uninstall tool or through the Control Panel, as shown above.
Change the Minecraft Launcher Path
Error 1 might come up if your Windows username has a special character. Fortunately, you can sort of bypass this issue by taking a “different route” to reach the Minecraft folder:
- Create a shortcut for “MinecraftLauncher.exe”.
- Right-click on the shortcut and click on “Properties”.
- Navigate to the “Shortcut” tab and spot the “Target” line.
- You’ll need to add the following at the end of the line and click OK: -workDir %ProgramData%.minecraft

Fixing the Minecraft Launcher Path
Reinstall Minecraft
If the issue persists, your last resort is to reinstall Minecraft. To do this, you must navigate to the Control Panel and uninstall the launcher. Then, you simply download your desired Minecraft version.
Conclusion
Hopefully, these fixes fix Minecraft error 1 and allow you to enjoy the game again. If you face any similar issues or want extra help, be sure to check out Minecraft Forum.