KoLmafia Veterans: A Java 7 Proposal

Catch-22

Active member
Most of you all know that Java 6 is the official recommended version of Java to be used with KoLmafia.

Some of you may not know, however, that Java 6 officially goes EOL in February 2013, just 2 months away!

What this means is Oracle will no longer be providing security fixes for Java 6 after this date. Some linux distros are already shipping without an option to run Java 6.

I propose that the veterans of KoLmafia, people who know their way around a Java installation and know how to report bugs well, upgrade their systems to Java 7 and start using it. I've been using Java 7 since the beta and I've only ever had a handful of issues with it on my system.

If you're having issues with Java 7, report the bug appropriately, with debug logs and steps to reproduce it. I'll personally look into each report (provided I notice it), even if nobody else does.

I can't find the post, but I believe Roippi has stated that he would not be opposed to committing patches for Java 7 fixes, provided they don't have any adverse affects on Java 5/6. Recently a commit was made which I believe will solve the majority of intermittent connectivity issues people may have been experiencing with Java 7 in the past.

We are currently limited to the feature set of Java 1.5, but that doesn't mean we should be limited to using out of date Java installations. I encourage you guys to give it a go and report any issues. Please mention in the report if you're certain the issue only occurs in Java 7.
 

heeheehee

Developer
Staff member
I've been running Java 7 for some time; the only problems I've been encountering are Java 7 + swing + xmonad (my window manager). Had to patch it; I think it works smoothly, now, for the most part. There was that one other issue with menus getting chopped off or something, but that's also a swing bug. Also, purely aesthetic.
 

Catch-22

Active member
Java 7 + swing + xmonad (my window manager). Had to patch it;

Is that you had to patch xmonad or KoLmafia? Was it a generic fix or something specialized?


There was that one other issue with menus getting chopped off or something, but that's also a swing bug.

I think I vagueley remember that, I don't think it was happening for me. Wasn't it to do with the Nimbus LAF?

I'm not sure what version the jdesktop libaries are, but there's possibly some fixes we can backport to Java 1.5, if that would resolve anything.
 

xKiv

Active member
I have also been running java7 (on linux) for almost a year now (I think the current version is u9?), and the only problems I can recall were focus related (not recognizing keyboard input after switching workspaces there and back again), which also happen out of mafia (and out of java), so nothing there.
But I am running without ipv6 (the machine has ipv6 capability, but I have no connectivity; I even disabled miredo (teredo tunneling client) because I don't understand ipv6 security).
 

heeheehee

Developer
Staff member
Is that you had to patch xmonad or KoLmafia? Was it a generic fix or something specialized?

I patched xmonad to advertise itself as one of the non-reparenting window managers that Swing explicitly looks for (everyone seems to use LG3D for the irony). So rather generic, I imagine, and very much a Swing bug.

I'm pretty sure I'm running mafia through IPv4 even though I have IPv6 capability; how do I enable this?

And regarding the various known bugs: http://kolmafia.us/showthread.php?10655 pointed me at http://kolmafia.us/showthread.php?11077 -- so yeah, Nimbus LaF breaks.
 

heeheehee

Developer
Staff member
Looks like to test IPv6, I just need to change the lines that set preferIPv4Stack to true... to false?

Doesn't seem to be connecting via IPv6, still :/
 

Catch-22

Active member
Looks like to test IPv6, I just need to change the lines that set preferIPv4Stack to true... to false?

Doesn't seem to be connecting via IPv6, still :/

I'm not sure what metrics Java uses to determine which stack to use, but it will always prever IPv4 if you have preferIPv4Stack set to true and IPv4 is available, it won't necessarily go to IPv6 if you have both enabled.

Try launching the JAR with the command line options -Djava.net.preferIPv6Addresses=true and -Djava.net.preferIPv6Stack=true and have the preferIPv4Stack line in KoLmafia.java commented out. Assuming you have IPv6 connectvity, this should force it to use the IPv6 stack.

Having said that, IPv6 issues are probably lower priority than ones that break the interface, because at the moment we can just force the IPv4 stack. IPv6 issues aren't really Java 7 specific, it's just that Java 7 is the first version of Java to offer IPv6 connectivity out of the box. No harm in trying it out though.
 
Last edited:

heeheehee

Developer
Staff member
Note, you'll also need to modify a line in request/GenericRequest.java.

Still can't get it to use IPv6 (and yes, I can access other sites with IPv6, e.g. Google). Does KoL support IPv6 in the first place?
 
Just trying out KoLmafia with Java 7 in Linux for the first time. No major bugs to report, but I have found some minor ones that don't impact KoLmafia's usability.
 

Catch-22

Active member
Still can't get it to use IPv6 (and yes, I can access other sites with IPv6, e.g. Google). Does KoL support IPv6 in the first place?

I don't think it's a matter of IPv6, but IPv6 to IPv4 tunneling (such as Teredo) that was causing issues, but the protocols are supposed to be pretty much transparent to the application layer.

I can't remember the specific details, but I believe an exception was being thrown at login that can only be thrown when the IPv6 stack is being used by the JVM (the exception doesn't exist otherwise). It's possibly a very platform specific exception, related to what tunneling protocol is being used etc.

I have found some minor ones that don't impact KoLmafia's usability.

Such as what?
 
Top