Don't mean to be 'teh n00b'

A

aphroguy

Guest
Hey guys, having a little trouble here and I don't even know if this is the right place to be posting, but it's the only place that even comes remotely close that I've found so far. I can't even get KOLMafia working. I'm running Kubuntu 6.06, installed JRE, following Java's instructions, DL'ed and unpacked the KOLMafia .jar, and now I have a nice, pretty KOLMafia folder on my desktop. Opening it yields nothing but trayicon gif's and directories with incomprehensible items. I haven't been able to figure out where the icon to actually RUN KOLMafia is located.

Like I said, I don't even know if this is where I should be posting this. If not, if someone could at least point me in the right direction, it'd be greatly appreciated!
 

holatuwol

Developer
Don't unpack it -- it's an executable JAR, not just a standard ZIP type JAR (theoretically the same thing, except for the manifest file).  Also, make sure that "which java" points to the JRE you installed, and not GCJ or any of its kin.  If all else fails, you might need to write a shell script to run mafia, containing the line:

Code:
java -Duser.dir=~/path/to/kolmafia/ -jar /path/to/kolmafia/KoLmafia-9.7.jar

On some systems, you need to specify a maximum heap size greater than 64M (KoLmafia shouldn't ever hit that, but if it does, you'll get weird OutOfMemoryException stack traces):

Code:
java -Duser.dir=~/path/to/kolmafia/ -Xmx128m -jar /path/to/kolmafia/KoLmafia-9.7.jar
 

aphroguy

New member
Thanks for the fast response, guys! I tried that, and actually got further than I did before, but with that first command you gave me, I got the following error:

Code:
root@POShizat:~# java -Duser.dir=/home/me/ -jar /home/me/KoLmafia-9.7.jar
Exception in thread "main" java.lang.ExceptionInInitializerError
  at java.lang.Class.initializeClass(libgcj.so.7)
  at java.lang.Class.forName(libgcj.so.7)
  at gnu.java.lang.MainThread.run(libgcj.so.7)
Caused by: java.lang.NullPointerException
  at javax.swing.JEditorPane.registerEditorKitForContentType(libgcj.so.7)
  at net.sourceforge.kolmafia.KoLmafia.<clinit>(Unknown Source)
  at java.lang.Class.initializeClass(libgcj.so.7)
  ...2 more

Said nothing about memory, so I didn't try that second code, as my system doesn't really have a lot of memory to allocate. (256MB, but integrated video, so about 24MB of that is allocated to graphics memory...... I know, I know...... ::) )

And I checked into the CLI a little bit and found that there's a backdoor to the GUI (priphea), so I thought that I might just be able to run the CLI from the terminal using

Code:
java -jar -Duser.dir=/home/me/ /home/me/KoLmafia.jar --CLI

but received the error message

Code:
Failed to load Main-Class manifest attribute from /home/me/KoLmafia.jar

as an output. JEBUS, I just don't know where to take things from here. Trying to open from the javaws program gives me a Java error message dialog. Any ideas after all this???
 
I'll leave the primary question for Holatuwol or another member of the kolmafia dev team to answer, but request some more information in case you make it back here before they do. This info may help them figure it out quicker.

What Operating system/platform are you using?
What version of Java are you using?

I'm using WinXP on an older celeron 1.2ghz system with 256 megs of ram and Java version 1.5.0 (build 1.5.0_09-b03) from Sun Microsystems http://www.java.com and running fairly trouble free by just double clicking the Jar file from explorer. If your using a different version of Java you might try this one and see if it works for you.
 

holatuwol

Developer
Since KoLmafia's not distributed as a .jnlp file, Java Web Start won't work.  To diagnose this error, type the following at the console and tell us what you see.

Code:
which java

You should see something similar to what's mentioned here:

http://forums.kingdomofloathing.com/viewtopic.php?p=1873716#1873716

In short, GCJ, which is distributed with Ubuntu rather than the SUN Microsystems distribution, is a 99% implementation of the Java runtime environment.  Unfortunately, the 1% of the JRE that it decided not to implement is exactly that 1% which KoLmafia uses most, and even more unfortunately, Ubuntu will almost always prefer GCJ over the one you just installed.  Linux: it's user friendly.

Edit: Since this problem, keeps coming up, I've gone ahead and added some debug assistance on the KoLmafia manual, accessible <a href="http://kolmafia.sourceforge.net/manual.html">here</a> (and via the link you see at the top).
 

aphroguy

New member
Okay, so here we go. I'm using Kubuntu 6.06 (Ubuntu with KDE rather than GNOME), running it on a bottom-of-the-line-four-years-ago (which means painfully so now....) HP Pavilion zt1135, 256MB, Pentium Celeron 1.3gHz processor. I installed the jre-1.5.0_09 .bin file from the java website.

"which java" command gives me /usr/bin/java

Let me know if you need any other information and I'd be more than happy to provide it!

Thanks so much for your continued efforts in this. I really appreciate it guys!
 

aphroguy

New member
The most recent version I have is the one that I DLed and installed from the Java website, and it's in my /usr/local/java/jre1.5.0_09 directory.
 
[quote author=aphroguy link=topic=569.msg2770#msg2770 date=1163049835]
And I checked into the CLI a little bit and found that there's a backdoor to the GUI (priphea), so I thought that I might just be able to run the CLI from the terminal using

Code:
java -jar -Duser.dir=/home/me/ /home/me/KoLmafia.jar --CLI

but received the error message

Code:
Failed to load Main-Class manifest attribute from /home/me/KoLmafia.jar

as an output. JEBUS, I just don't know where to take things from here. Trying to open from the javaws program gives me a Java error message dialog. Any ideas after all this???
[/quote]

OK I really don't want anyone to think I am doubting their intelligence by saying this, and I just noticed this myself. On my computer the filename for the most recent version of kolmafia is "KoLmafia-9.7.jar" and there is a "KoLmafia-9.4.jar" in the same directory so I am wondering could this be a simple mistake of trying to load a file (kolmafia.jar) that does not exist? Sometimes the simplest mistakes can be really confusing and it would definitely fail to load the manifest file in that case.

Probably not the problem but figured I'd mention it.




[quote author=aphroguy link=topic=569.msg2781#msg2781 date=1163219865]
The most recent version I have is the one that I DLed and installed from the Java website, and it's in my /usr/local/java/jre1.5.0_09 directory.
[/quote]

Noting the term "the most recent version" try using the full path to java in your command line.
something like:
Code:
/usr/local/java/jre1.5.0_09/java -Duser.dir=~/path/to/kolmafia/ -jar /path/to/kolmafia/KoLmafia-9.7.jar

Your system may be still trying to use one of the older versions of Java.

If I remember right my system using an old version of Java happened to me a long time ago and I think it generated a similar error message. I know I have seen an error related to a manifest file at one point. Again if I remember correctly my final solution was to remove all versions of Java and install the correct version over again. This was around a year ago, and that's a years worth of fixing various problems on many computers so my memory may be crossing problems with solutions though.




One last thing....if you are still using the same copy of kolmafia that you used an unzip utility or unpacked in some way, then the program used to unzip it may have tried to repair what it thought was a damaged file.

[quote author=holatuwol link=topic=569.msg2746#msg2746 date=1162820095]
Don't unpack it -- it's an executable JAR, not just a standard ZIP type JAR (theoretically the same thing, except for the manifest file). [/quote]

Logically based on the quote from Holatuwol, if they are the same except the manifest file, then the unzip/unpack utility would possibly destroy the manifest file (or data about it) if it was trying to repair the jar file. Try downloading a new copy of the jar to a fresh directory.
 

aphroguy

New member
Thanks for the detailed and in-depth troubleshooting, efilnikufecin, but nothing's working. If I'm not opening the file with javaws, I'm not exactly sure what I SHOULD use to open it. I dunno, I think I may just call KoLmafia a loss on Kubuntu. I've got firefox with greasemonkey, and I installed all the KOL scripts I could find for that, so I've got some useful features in browser-based KOL. I just wish I could get KOL mafia up and running, cause my clicking-finger still gets tired out. ;-) Anyway, thanks for the help, everyone! It's much appreciated. I'll still keep checking the forum for any updates or revelations, though, just in case! So if anyone has any input, feel free to post and I'd be willing to give it a shot! Again, thanks guys!
 

holatuwol

Developer
You should use java, not javaws.  Does this command (a modified version of the one posted by efilnikufecin) work?  What I added was a "bin" directory, since Java tends to sit in ./bin rather than in ./ relative to the Java installation directory.

/usr/local/java/jre1.5.0_09/bin/java -Duser.dir=/home/me/ -jar /home/me/KoLmafia-9.7.jar
 

aphroguy

New member
Hey holatuwol,

That command is, I think, getting warmer. Gives me a bit more of an error message.

Code:
root@POShizat:~# /usr/local/java/jre1.5.0_09/bin/java -Duser.dir=/home/me/ -jar /home/me/KoLmafia-9.7.jar
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at net.sourceforge.kolmafia.CreateFrameRunnable.runConstruction(Unknown Source)
    at net.sourceforge.kolmafia.CreateFrameRunnable.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
    at java.awt.GraphicsEnvironment.checkHeadless(Unknown Source)
    at java.awt.Window.<init>(Unknown Source)
    at java.awt.Frame.<init>(Unknown Source)
    at java.awt.Frame.<init>(Unknown Source)
    at javax.swing.JFrame.<init>(Unknown Source)
    at net.sourceforge.kolmafia.KoLFrame.<init>(Unknown Source)
    at net.sourceforge.kolmafia.LoginFrame.<init>(Unknown Source)
    ... 13 more

Do you think my computer's just upset that I named it the POShizat? ;)

I have no clue what any of this message means, but if it makes sense to anyone, let me know what I'm doing wrong.
 

aphroguy

New member
Okay, now holatuwol, before I say this, I want you to know that this is not an accreditation that I hand out left and right; it's reserved for the special, the elite, the best of the best:

You the man.

Not running as root did it, using the same command you gave me in your last post. I was just under the assumption that anything a regular user could do, the root could do BETTER. Apparently not.

Well thanks to everyone who helped me through this. Anyone who offered help is more than welcome to kmail me in-game (same SN: aphroguy) and I'd love to throw a little meat your way for your time and efforts. (Plus, lord knows I love throwing around meat..... ;) ) So yes, thanks again, this case is closed, and I will take what I've learned here and be sure to share it with my buddies who are also using Kubuntu and have KOL accounts.
 
[quote author=aphroguy link=topic=569.msg2792#msg2792 date=1163390417]
Do you think my computer's just upset that I named it the POShizat? ;)
[/quote]

Heh I would be! :p

Glad to hear your problem is solved :)
 
Top