There are several "wrong" ways to install and launch mafia. This post is my attempt to capture a right way. Ideally my comments will be verified and someone more interested in technical writing than I currently am, will make a simple set of instructions and post a sticky or edit the wiki or both.
My comments are based on Windows 10 although there is a lot of anecdotal evidence that nothing is dependent upon a specific Windows version.
There are three basic steps: Installing or Verifying Java; "Installing mafia"; and Running mafia.
Currently Java 17 is recommended for mafia. Running an older version will be a problem. Running a newer version may be a problem. If running mafia is a problem and the version is not 17 then at some point installing and using v17 will be suggested. Instructions for installing java are elsewhere and enough out of scope that a separate set of instructions is called for.
Mafia works best on Windows if the jar file is in a directory that the Windows user running mafia can write files in. A subdirectory in the users Documents file is recommended although knowledgeable users can use something else. C:\Users\frono\Documents\KoLmafia is an example. How to find and download a mafia jar file is also better handled as its own topic but whatever is done the jar file needs to be copied or moved into the directory where mafia can create or access settings. In this context "updating" mafia means getting the latest jar file, copying it to the mafia directory and deleting any older jar files that are there.
If the file associations for Java are correct then the preferred way to run is to navigate to the directory containing the jar file and then double click on it. Alternatively a command prompt can be opened with the current directory set to the directory containing the jar file and the command "java -jar <complete name of mafia jar file>" issued. Many people choose to make a batch file or shortcut to launch mafia. I have a shortcut to the directory containing mafia on my desktop and I open it then find the jar file and double click.
In the spirit of self help the following things should be considered.
If the Java installation is suspect then opening a command prompt and typing "java --version" is a good diagnostic. Any results other than something that indicates Java 17 or better is installed means that Java needs to be installed (or the installation needs to be fixed) or up/down graded.
If Java seems right but the login screen never appears then running mafia from the command prompt (java -jar <complete name of mafia jar file>) should capture error and status messages that may assist in diagnosing the problem.
I mafia seems to have a problem finding or creating files then it is possible that the launch technique is causing mafia to use the "wrong" directory or the user cannot write files in the mafia directory. If there is a reference to C:\Windows\System32 or similar there is definitely a problem with where the jar file is located or how mafia is launched.
Using Quick Access or Recent file lists to launch mafia is known not to work.
Making the mafia directory on the Desktop sometimes fails to work.
Running multiple instances of mafia with the same character is not supposed to work and a problem with the lock file should go away when all instances are shutdown. Sometimes mafia fails to shut down cleanly in which case all instances should be stopped and shut down and then the lock file manually deleted by the user.
If double clicking on the jar doesn't work or opens up something other than Java the file association can be reset by right clicking on the jar, selecting open with and navigating to the correct version of Java.exe.
My comments are based on Windows 10 although there is a lot of anecdotal evidence that nothing is dependent upon a specific Windows version.
There are three basic steps: Installing or Verifying Java; "Installing mafia"; and Running mafia.
Currently Java 17 is recommended for mafia. Running an older version will be a problem. Running a newer version may be a problem. If running mafia is a problem and the version is not 17 then at some point installing and using v17 will be suggested. Instructions for installing java are elsewhere and enough out of scope that a separate set of instructions is called for.
Mafia works best on Windows if the jar file is in a directory that the Windows user running mafia can write files in. A subdirectory in the users Documents file is recommended although knowledgeable users can use something else. C:\Users\frono\Documents\KoLmafia is an example. How to find and download a mafia jar file is also better handled as its own topic but whatever is done the jar file needs to be copied or moved into the directory where mafia can create or access settings. In this context "updating" mafia means getting the latest jar file, copying it to the mafia directory and deleting any older jar files that are there.
If the file associations for Java are correct then the preferred way to run is to navigate to the directory containing the jar file and then double click on it. Alternatively a command prompt can be opened with the current directory set to the directory containing the jar file and the command "java -jar <complete name of mafia jar file>" issued. Many people choose to make a batch file or shortcut to launch mafia. I have a shortcut to the directory containing mafia on my desktop and I open it then find the jar file and double click.
In the spirit of self help the following things should be considered.
If the Java installation is suspect then opening a command prompt and typing "java --version" is a good diagnostic. Any results other than something that indicates Java 17 or better is installed means that Java needs to be installed (or the installation needs to be fixed) or up/down graded.
If Java seems right but the login screen never appears then running mafia from the command prompt (java -jar <complete name of mafia jar file>) should capture error and status messages that may assist in diagnosing the problem.
I mafia seems to have a problem finding or creating files then it is possible that the launch technique is causing mafia to use the "wrong" directory or the user cannot write files in the mafia directory. If there is a reference to C:\Windows\System32 or similar there is definitely a problem with where the jar file is located or how mafia is launched.
Using Quick Access or Recent file lists to launch mafia is known not to work.
Making the mafia directory on the Desktop sometimes fails to work.
Running multiple instances of mafia with the same character is not supposed to work and a problem with the lock file should go away when all instances are shutdown. Sometimes mafia fails to shut down cleanly in which case all instances should be stopped and shut down and then the lock file manually deleted by the user.
If double clicking on the jar doesn't work or opens up something other than Java the file association can be reset by right clicking on the jar, selecting open with and navigating to the correct version of Java.exe.