Having trouble opening .jar or .exe Mafia on new computer

I remembered having a similar problem previously, so I looked up to see my previous messages, hoping to mine some useful advice that I could re-use. No such luck, so maybe I'll be lucky enough to get some wizards to help me again?

(From August 2014: http://kolmafia.us/showthread.php?16076-Problems-with-recent-SVN-builds )

My problems are very similar to the last time. I double click the .jar file, but no Mafia window opens, and nothing shows up in the task manager. Same thing for the .exe file.

In the hopes of skipping ahead, I've already looked up the details that were requested last time:

  1. What is your OS?
  2. What is your version of javascript?

My OS is Windows 10.
The version of Java is version 8, upgrade 111. I tried uninstalling it and re-installing it as well, which didn't produce any new results.

I would suggest opening a command prompt window, navigating to the folder with mafia, and running "java -jar KoLmafia-{whatever}.jar", which will hopefully give some useful output. Try this with a version of mafia that works by double-clicking to check that this is all working properly, then try with a nonworking version and there will hopefully be some relevant output.

If it's potentially useful, this is what that output gave me: http://i.imgur.com/ZB9gMUW.png
 

gulaschkanone

New member
Since I'm a lazy fuck i don't actually have a build and debug environment for Mafia, but looking at the code and testing a little bit seems to indicate that empty GLOBAL_prefs should never happen, and the code in main assumes that some basic preferences are initialized to nonzero things, and it crashes and burns upon stumbling over those empty preferences (here you can see that it fails basically because it tries to convert an empty string to a color). Since it's a directory on your desktop, I have no idea why something like this would fail, but try it in another folder you definitely have write access to, I guess?
 

lostcalpolydude

Developer
Staff member
Somehow it's trying to set GUI values
Code:
DataUtilities.toColor( Preferences.getString( "innerTabColor" ) );
without first setting default values for settings (so innerTabColor is an empty string). It isn't a surprise that toColor() fails there, but I can't reproduce this, so I don't know what to fix. Maybe it's newer versions of Java 8 that have an issue?
 

fronobulax

Developer
Staff member
I'm running Java 1.8.0_111 64 bit with no problems so I don't think we should directly blame Java.

I assume C:\Users\Dave!\EVERYBODY START\kolmafia is the directory that contains the Kolmafia.jar file. What other files and directories are in there? Can the user that is running actually read and write files there? Does deleting all the files and subdirectories there (except the mafia jar) and running again give different results? Would you consider creating C:\kolmafia, copying the jar file there and starting it there? Is there free space on the disk?

I am old school and worry about things that do not need to be worried about but with both a space and an exclamation point in the path name it is possible something that is parsing to find or create files is not working in KoLmafia. Both of those were "no noes" in the days of 8.3 file names.
 
I actually noticed something sort of similar on my new laptop yesterday:
- I simply copied over the full KoLMafia folder from my old laptop, grabbed the newest nightly build, and tried to run it.
Nothing.
- Ok, maybe I didn't click it properly, lets try again.
Still nothing.
- Repeat once more.
More nothing.
- Ehm, I dunno what's up, lets (re)download the newest build and try again
A big nothing.
- Eh, maybe it's because I had a shortcut on my desktop? Lets make one and double click that.
Once again nothing.
- Ok, this is getting kinda strange, and I'm getting frustrated. Rapidly click the shortcut 5 or so times, with the task manager open to see if java is doing anything.
And behold, mafia started, though, despite 'starting' it 8 or so times in this series (which took maybe 2 minutes, I was going through these motions kinda fast), I got exactly one login screen and only one instance was running.

Edit: Since then, I've been able to start it multiple times without any issue, I even grabbed a new nightly build today without problems.
 
Last edited:

Magus_Prime

Well-known member
I simply copied over the full KoLMafia folder from my old laptop, grabbed the newest nightly build, and tried to run it.

There may be file system permissions issues with Windows 10. What is the full path to where you copied the KoLMafia folder?

Do other Java programs run properly on this computer?
 
Did you even read to the end?

But, in case it matters, both laptops are Windows 10, and on both sides, the path is "D:\Games\Kingdom of Loathing\KoLMafia"
 
Last edited:

Magus_Prime

Well-known member
I did read to the end and the path does matter.

Windows 10, in an attempt at protecting the user, puts barriers in place to prevent certain things when files are outside the user profile.

Try copying the files a directory under your user profile and running from there. If that works then it's a file system permissions issue.
 
So: there was some weird issue with my new (and temporary) laptop, where on a reboot, it was trying to sign me in as some user that didn't exist any more. So I did a full reset of it, reinstall of Windows 10 and all that.

I was hoping that something that simple would just fix the issue, especially since Mafia was originally working (briefly) when I first got the laptop home yesterday. But no such luck.

Also, thank you to all who have tried to help so far, your assistance is greatly appreciated, even if the problem isn't yet solved.

I assume C:\Users\Dave!\EVERYBODY START\kolmafia is the directory that contains the Kolmafia.jar file. What other files and directories are in there? Can the user that is running actually read and write files there? Does deleting all the files and subdirectories there (except the mafia jar) and running again give different results? Would you consider creating C:\kolmafia, copying the jar file there and starting it there? Is there free space on the disk?

I am old school and worry about things that do not need to be worried about but with both a space and an exclamation point in the path name it is possible something that is parsing to find or create files is not working in KoLmafia. Both of those were "no noes" in the days of 8.3 file names.
- Running in the Users\Dave!\ folder still gives the same result (with the fresh new install, it is now called EVERYTHING GOES instead of EVERYBODY START, but that's the only change): http://i.imgur.com/FbvJxdM.png

- Creating a new empty folder with only the .jar file in it, and attempting to run it gives an identical screenshot to the one above (with different folder name, of course).
--- Running it in the empty folder creates four new folders: "images", "scripts" (both are empty folders), "settings" (which contains a 0-byte text file GLOBAL_prefs.txt, and "relay" (which has all of these files http://i.imgur.com/8Xarchm.png )

- Creating c:\kolmafia and sticking my .jar file in there did mostly nothing, which seems to be a result of not having the permissions to write or something? Doing it into an empty folder gave a string of about 15 of these type of errors. I directly copied my pre-existing (and previously-working) Mafia files into that folder, just to get it trimmed down to something that would fit in a single screenshot: http://i.imgur.com/25vYGTr.png

- My previous two laptops both had the same User name, exclamation point and all, and neither one had any issue with running Mafia. I don't know if that would be the cause of any problem here, but by the time your response was posted, I was already knee-deep in the re-install process, so I couldn't confirm that with a lack of !.


8u40 is the one that works for me. It looks like you can download that from http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html .
Before the re-install, I tried with the older version of Java, but it didn't produce any different results at all.


I actually noticed something sort of similar on my new laptop yesterday....
...and I'm getting frustrated. Rapidly click the shortcut 5 or so times, with the task manager open to see if java is doing anything.
And behold, mafia started, though, despite 'starting' it 8 or so times in this series (which took maybe 2 minutes, I was going through these motions kinda fast), I got exactly one login screen and only one instance was running.

Edit: Since then, I've been able to start it multiple times without any issue, I even grabbed a new nightly build today without problems.
Your story gave me hope, and I tried your method of getting frustrated and clicking to open it a bunch of times. It didn't produce the same results for me, but maybe it could sense that my frustration wasn't enough. Maybe I'll try again if nothing else can help me.
 

lostcalpolydude

Developer
Staff member
This particular issue could be fixed by explicitly calling Preferences.ensureGlobalDefaults(), making sure those values aren't blank. But that static block should be run when Preferences is imported. I suspect that making this one thing not break will just lead to something else breaking for the same reason...
 

Theraze

Active member
Try running in an explicit Administrative command prompt. Win-X, Command Prompt (Admin), cd "C:\Users\Dave!\Desktop\EVERYTHING GOES\kolmafia", java -jar KoLmafia-17632.jar.

If that does work, which it probably will, I'd suggest switching from java to javaw to let you close the command prompt while it's working, but...
 

gulaschkanone

New member
It seems quite likely that it is some kind of IO error caused by a file rights issue or whatever, but Preferences.java catches IOException in a few places only to swallow it with empty exception handlers. I'd wildly guess that actually doing something instead of nothing for those handlers, like outputting the exception stack trace, would make it a bit easier to comprehend the precise issue that causes Tooth's woes.
 
I figured out a workaround for my issue, since it only really needs to get me through for a couple weeks -- my good laptop is away getting repairs, so I'm on a temporary loaner until then.

The workaround is that I tried opening the .jar file straight from a flash drive, rather than a kolmafia folder on the hard drive. Lo and behold, it opened up just fine. So for the next week or two, I'll just be running my Mafia off of an external hard drive.

Hooray, and thanks again to everybody who had words of advice for my dumb problem.
 

fronobulax

Developer
Staff member
I figured out a workaround for my issue, since it only really needs to get me through for a couple weeks -- my good laptop is away getting repairs, so I'm on a temporary loaner until then.

The workaround is that I tried opening the .jar file straight from a flash drive, rather than a kolmafia folder on the hard drive. Lo and behold, it opened up just fine. So for the next week or two, I'll just be running my Mafia off of an external hard drive.

Hooray, and thanks again to everybody who had words of advice for my dumb problem.

Interesting. There are some Windows 10 features/bugs where users are unable to write to the local disk even when they logically should be able to do so. There are cases where Windows thinks some a file came from the internet or other untrusted source and treats it with care before allowing access. Not sure how much to worry about this since it is temporary and you have a workaround.
 

fronobulax

Developer
Staff member
It seems quite likely that it is some kind of IO error caused by a file rights issue or whatever, but Preferences.java catches IOException in a few places only to swallow it with empty exception handlers. I'd wildly guess that actually doing something instead of nothing for those handlers, like outputting the exception stack trace, would make it a bit easier to comprehend the precise issue that causes Tooth's woes.

r17641 and r17642

All I did was emit something in the previously empty catch blocks and i decided the complete stack trace was overkill, but next time we may get something...
 

Theraze

Active member
So we want to move this to Community Support, as it appears to be an issue with the machines used by TAMT and TD doing... something?
 
Top