regarding Java 7

roippi

Developer
A number of users are starting to upgrade to Java 7, as it's the highest version offered by Oracle, and higher numbers always mean better, right? Unfortunately, not in this case.

As of this writing, the official recommendation from the developers of KoLMafia is to use Java 6. Users who wish to use Java 7 should do so at their own risk, with the full understanding that Mafia is not developed under Java 7. Think of it as running an "experimental" branch of code - if you are not a technically savvy enough person to be doing that, you should be using the far less buggy Java 6. In fact, I consider myself fairly technically savvy, and I use Java 6. 7 is just not ready for widespread use right now. And if you're worried about losing any cool features by downgrading - I can promise that you won't.

The most important point to take home: before reporting bugs in this forum, confirm that the bug exists under Java 5 or 6.* If it doesn't, well, it's a Java bug!

*in rare cases, java 7 may uncover buggy behavior that was escaping notice under java 6; but again, you need to be a sufficiently technically savvy person to know when this applies.
 
There are quite a few Java 7-only bugs that have yet to be fixed, some of them specific to the new OS X port Oracle is maintaining. For example: If you run KoLmafia with Java 7 and navigate to the Daily Deeds panel, you may find truncated buttons. This one's already been reported here and found to be a Java bug, not a KoLmafia bug. Another example is the DnD (Drag and Drop) regression/bug in Java 7. The key takeaway: Users beware!
 
Good news: the truncated buttons bug and drag/drop bug mentioned in my previous post have both been fixed in 7u6 (7u7 has been released since then to fix a security flaw).
 

heeheehee

Developer
Staff member
Are there any other outstanding issues with (mafia and) Java 7, or can we go ahead and declare that it's now safe to upgrade? I've been mainly using Java 7 for now, and aside from window manager patches (to get Swing and focus to work properly with a non-reparenting window manager under Java 7), I haven't really run into anything else.
 

AlbinoRhino

Active member
I had been using Java 7 without any mafia issues for quite some time. The other day I updated to Java 7 update 7 (from Java 7 update 6). I started experiencing a strange issue where mafia would just stop for up to about 30 seconds and then continue. I couldn't figure out any definite pattern to the pauses. Sometimes it would happen when my afteradventure script was running, sometimes mid-fight, sometimes during restoration. Other than these strange delays everything worked fine. Just strange pauses and then mafia would continue as normal. Since I had finally run into an issue with Java 7, I downgraded to Java 6 update 35 (rather than back to 7u6) and the issue disappeared. This was with Windows 7 x64 and 32 bit Java.
 

Theraze

Active member
Are there any other outstanding issues with (mafia and) Java 7, or can we go ahead and declare that it's now safe to upgrade? I've been mainly using Java 7 for now, and aside from window manager patches (to get Swing and focus to work properly with a non-reparenting window manager under Java 7), I haven't really run into anything else.

Since mafia is coded to work with Java 1.5, not Java 1.7, the time when it's safe to tell people to update to Java 1.7 and not have any issues is when mafia is coded to work with Java 1.7... right? :) I mean, we're dealing with two mafia iterations of changes... really 3, since mafia was coded for Java 1.4 and while awesome work has been done in the process of breaking 1.4 compatibility, not everything has been changed to 1.5 best practice.

:) Yet.
 

heeheehee

Developer
Staff member
Unfortunately, this is NOT yet the case. See this bug: http://kolmafia.us/showthread.php?1...ia-swingui-AdventureFrame-could-not-be-loaded

This is caused by a problem within Java, specific to Java 7 (tested in Java 6, doesn't occur there). The good news is that the most annoying of the bugs in Java 7 HAVE been fixed now.

Ah right, I forgot about that thread. I can't seem to reproduce, though, but it could be OpenJDK (java version "1.7.0_b147-icedtea") not having this particular bug.

Since mafia is coded to work with Java 1.5, not Java 1.7, the time when it's safe to tell people to update to Java 1.7 and not have any issues is when mafia is coded to work with Java 1.7... right? :) I mean, we're dealing with two mafia iterations of changes... really 3, since mafia was coded for Java 1.4 and while awesome work has been done in the process of breaking 1.4 compatibility, not everything has been changed to 1.5 best practice.

:) Yet.

If that were the case, then we wouldn't be telling people to use Java 6, no?
 

Catch-22

Active member
If that were the case, then we wouldn't be telling people to use Java 6, no?

Java is supposed to be somewhat backwards compatible, if you compile with your javac target set to 1.5 it should be compiling 1.5 compatible class files, even if you use Java 7. This is what "1.5 compliant" means when we talk about KoLmafia. When we're programming KoLmafia we should be referring to components in the 1.5 API, not 6 or 7. I am actually really looking forward to moving to Java 6 compatibility because there's a few new libraries in the API we can use to get rid of some really yucky legacy code lying around, but until then we can't use libraries that are not available in earlier versions of Java.

Some of the problems people see when using Java 7 are related to new exceptions that are only being thrown now whereas earlier versions of the JRE would ignore them. Other problems are just plain bugs with Java 7.

There's a lot of bad flak Java 7 is getting, certainly some of the earlier versions were severely buggy and dangerous to be using (security flaws everywhere), but a lot of it is simply related to unexpected behaviours occurring due to the use of old or deprecated elements of the API.

Java 6 has been around for 6 years now and they're still finding bugs with it, but a lot of them have been ironed out over the years and it's pretty stable for use in running classes targeting 1.5.

Java 7 is only a little over a year old, a lot of issues still persist but it's actually pretty good for the most part.

What people need to remember is that a lot of stuff in KoLmafia is fairly legacy code, it was originally written for 1.4 which is now 10 years old. A chunk of stuff has been migrated to 1.5 best practices, but the efforts are still ongoing. 1.5 is 8 years old and it's no surprise that JRE 6, having been maintained for over 6 years, runs 1.5 classes pretty well.

I guess what Theraze is trying to say is that given KoLmafia is a bit behind the curve when it comes to the latest Java revisions, people shouldn't expect full compatibility with Java 7 in too much of a hurry.
 
Last edited:

Theraze

Active member
Yeah... don't expect Java 1.7 to do as well as Java 1.6's current backwards compat level for four years or so. :)

If you want the most solid mafia experience, yes... by all means, use Java 1.5. You might notice some web-blips from things that aren't coded to your level anymore.
If you want a good mafia experience while not noticing anything missing in the web, use Java 1.6.
If you want an exciting mafia experience while noticing weird issues with the web you've never seen before, and love searching for other people you've never talked to who have your same exact issue in something else despite it not happening on any other computer you've tried or for anyone else you've seen IRL, use Java 1.7.
 

Winterbay

Active member
I am actually really looking forward to moving to Java 6 compatibility because there's a few new libraries in the API we can use to get rid of some really yucky legacy code lying around, but until then we can't use libraries that are not available in earlier versions of Java.

I believe that Jason (and possibly hola) are on systems where the latest version available is Java 5 and so an update to java 6 may take quite some time I guess...
 

Bale

Minion
It is as Winterbay says. For Macs, Java is limited by the System's OS. Unless they update their computers they cannot actually use Java 6. Since they are so limited, it is reasonable to assume that many other Mac users are on systems that only go up to Java 5. We would not want to prevent a reasonably large population of Mac users from using KoLmafia, so we should not try to update to Java 6 yet.
 

holatuwol

Developer
Tiger works great for watching anime, organizing my music on iTunes and just generally surfing the web, which is about all I do. :D Why upgrade when you don't need to?

Though I'm about to upgrade the memory on it, since newer fansubs are encoding at these crazy higher resolutions (guess because download speed and disk space are cheap) and only having 512 MB available is causing the frames to skip really bad even with high latency buffering on VLC.
 
Last edited:

Catch-22

Active member
Did you read the comments below, which are all from people saying that the above Java 1.6 doesn't actually install for them? :)

Yes, I read what the people who were not able to solve problems for themselves wrote :p

For anyone who is interested:

/System/Library/Frameworks/JavaVM.framework/Resources/version.plist
/System/Library/Frameworks/JavaVM.framework/Resources/Info-macos.plist


Rename these files to something else (eg. .bak) and try installing the package again.
 

Theraze

Active member
Well, you might want to pass that along to them, since of the 7 total comments, 1 (first) is thanks, 5 are people who need your fix, and 1 is griping about Apple/Java.

Just saying if you're going to link people to a page and say "Hey! Fixes!" it's probably good to make it a fully functional package for them, complete with any other hacks you know they're going to need. ;) Especially if your goal is to eventually eliminate 'official' support for them, meaning that your link needs to work for any computer newb out there.
 

Catch-22

Active member
Well the reason I didn't link to everything is because I haven't personally verified it as working, I don't have a mac. I simply typed "Java 6 on Tiger OS" in the google machine, and it came up with that article as well as a few other forums discussing how to get the Java package to install. I guess it doesn't hurt to comment on the original article (thankfully it didn't require me to sign up), so I did that, but I gather those folks are long gone by now.
 

Darzil

Developer
Is it possible (within KolMafia) to specify that a particular version of Java be used ? Just wondering, as at work we have various applications which use Java, and some can specify which version they want, whilst others just use the newest that is on the PC. Currently they have four java versions, which coexist happily (well, apart from the Java control panel, which only serves the most recent version), allowing a PC to have a recent Java whilst some older apps get to use an older version (1.4.2_02 is the oldest I think).

I'm uncertain how tricky (or possible) it would be to code, but might allow people to have Java 5 for KolMafia, whilst having Java 7 for general web use.
 

Theraze

Active member
That's on their side. The user launches the specific version of Java they want and targets the mafia jar. Boom. Done.

The issue behind backward compatibility though is that Java 7 has (at this point) sketchy BC. And we can't update to a newer version of base Java until either all the mac users update their macs, or we decide to abandon hola. Which we won't do as long as he still has the slightest interest in KoL and mafia...
 
Top