Bug - Not A Bug net.sourceforge.kolmafia.swingui.AdventureFrame could not be loaded

This has only been tested on Linux with the Nimbus LAF selected. If the OS default LAF is used instead, this error does not occur. See attached debug log for the details of what went wrong.

EDIT: Tested this on OS X 10.8 "Mountain Lion". No error, even when using Nimbus. Therefore I suspect some Linux-specific bug somewhere is the cause.
 
Last edited:
I can tell you 2 things that you'll have to check:
1: You're using Java 7 update 3. Latest version is Java 7 update 7. Does this happen in update 7?
2: KoLmafia is noted for not being fully compatible with Java 7 at this point. Does this happen in Java 6 update 35?

It is possible to have 2 JREs installed on your machine. If you can only get mafia to run on 6, then you can set things up so that mafia's .jar run directly from the JRE6 /bin.
It's such a hassle to install Oracle's JRE/JDK on Ubuntu that it simply isn't worth it... that being said, I can certainly test this on Java 6 easily enough (though it won't be on version 6u35).
 

holatuwol

Developer
It's such a hassle to install Oracle's JRE/JDK on Ubuntu that it simply isn't worth it... that being said, I can certainly test this on Java 6 easily enough (though it won't be on version 6u35).
In case it helps you out, I have an alias / shell function / whatever it's called that I run to switch between different major versions of the Oracle JDKs after I've dropped the unzipped version into /usr/lib/jvm (since that's really all the .bin file that you download does).

Code:
javahome() {
	CLEANUP_JAVA=`update-alternatives --list java 2>&1 | grep warning | cut -d' ' -f 4`

	for java in $CLEANUP_JAVA; do
		sudo update-alternatives --remove java $java >& /dev/null
	done

	if [ "" != "$JAVA_HOME" ]; then
		export PATH=`echo $PATH | sed -e "s;:$JAVA_HOME/bin;;g"`
	fi

	export JAVA_HOME=`ls -l /etc/alternatives/java | cut -d' ' -f 10 | awk 'BEGIN { FS = "/" } ; { print "/usr/lib/jvm/" $5 }'`

	if [ "" != "$1" ]; then
		if [ -f /usr/lib/jvm/$1/bin/java ]; then
			export JAVA_HOME=/usr/lib/jvm/$1
		elif [ "openjdk" = "$1" ]; then
			export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
		else
			for file in /usr/lib/jvm/jdk1.$1.*; do
				if [ -f $file/bin/java ]; then
					export JAVA_HOME=${file}
				fi
			done
		fi

		JAVA_AVAILABLE=`update-alternatives --list java | grep $JAVA_HOME`

		if [ -z $JAVA_AVAILABLE ]; then
			ALT_ID=`echo $JAVA_HOME | egrep -o '[0-9]' | perl -ne 'chomp and print'`

			sudo update-alternatives --quiet --install /usr/bin/java java $JAVA_HOME/bin/java $ALT_ID
		fi

		sudo update-alternatives --quiet --set java $JAVA_HOME/bin/java
	fi

	export PATH=$PATH:$JAVA_HOME/bin
	echo PATH=$PATH

	echo JAVA_HOME=$JAVA_HOME
}

Basically I just type javahome # and it switches to Java 4/5/6/7 by updating the java alternatives group to point to the right folder in /usr/lib/jvm and then updating both the PATH and JAVA_HOME environment variables to also point to that folder. Typing javahome by itself just updates the PATH and JAVA_HOME environment variables to what's currently pointed at in /etc/alternatives.

Edit: The alias had it so that there was still a minor hassle to uninstall, but then I realized I could script the removal of dead alternatives as part of switching so I've updated the alias and it's no longer a minor hassle. :)
 
Last edited:
Thanks, this is useful - I've copied it to a text file called javahome.sh. Now how do I set it up so I can invoke it the way you describe? That part's not clear to me.

REMINDER: I need to make an Oracle SSO account so I can download the relevant JDK versions, once I get this li'l script set up.
 

holatuwol

Developer
When you download the .bin file or the .tar.gz file from Oracle, then whenever you run it or unzip it, it'll create some folder called jdk1.x.0_yz, where x is the major version of Java and yz is the update version. If you move that folder to /usr/lib/jvm then the directory structure of /usr/lib/jvm will look like this:

Code:
:~$ ls -1 /usr/lib/jvm
default-java
java-1.6.0-openjdk
java-1.7.0-openjdk-amd64
java-6-openjdk
java-7-openjdk-amd64
java-7-openjdk-common
jdk1.4.2_19
jdk1.5.0_22
jdk1.6.0_35
jdk1.7.0_07

That's really it for how you setup Java.

As for setting up the script itself, if you've copied the inner part of that function into a shell script called javahome.sh and you've placed that shell script on your path, then javahome.sh 5 will switch you to jdk1.5.0_22. For me, I just copied the whole javahome() function into my .bash_aliases file in my home folder, which gets loaded whenever I open a shell.

That being said, I suspect that the script only works reliably if there's only one update version for each major release (so only one 1.4, only one 1.5, only one 1.6, only one 1.7). If you have more than one, then it'll wind up choosing the last one that is seen in the for loop (which might be the latest release, but it might not be ... I'm not sure there's any guarantees on for loop iteration order in bash).
 
Last edited:
The test results are in!

Does NOT work on Java 7u7.
Works on Java 6u35.
Impossible to test on 5u22.

Therefore, the designation as "Not a Bug" is correct - this is a Java bug, not a KoLmafia bug.
 

Bale

Minion
I was starting to wonder if it was finally safe to update to Java 7. I guess I know the answer now.
 

Catch-22

Active member
Nimbus came in with Java SE 6u10, so it's no surprise it doesn't work properly when the compiler target is 1.5.

Dead thread, I know, but I have a feeling this "Not A Bug" will work itself out as we migrate to newer versions.
 
Top