Menu

Running robode in Ubuntu 7.04 (Feisty)

Help
robopinky
2007-05-07
2012-09-15
  • robopinky

    robopinky - 2007-05-07

    I'm trying to run Robocode in Ubuntu 7.04 (Feisty Fawn).

    When trying to install the robocode-setup-1.2.6A.jar i get the following error(s):
    pinky@pinky-laptop:~$ java -jar /home/pinky/Desktop/robocode-setup-1.2.6A.jar
    Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit
    at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)
    at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(libgcj.so.70)
    at java.awt.Window.<init>(libgcj.so.70)
    at java.awt.Frame.<init>(libgcj.so.70)
    at java.awt.Frame.<init>(libgcj.so.70)
    at javax.swing.SwingUtilities$OwnerFrame.<init>(libgcj.so.70)
    at javax.swing.SwingUtilities.getOwnerFrame(libgcj.so.70)
    at javax.swing.JOptionPane.<clinit>(libgcj.so.70)
    at java.lang.Class.initializeClass(libgcj.so.70)
    at robocode.AutoExtract.main(Unknown Source)
    Caused by: java.lang.UnsatisfiedLinkError: libgtkpeer: libgtkpeer.so: kan inte öppna delad objektfil: Filen eller katalogen finns inte
    at java.lang.Runtime._load(libgcj.so.70)
    at java.lang.Runtime.loadLibrary(libgcj.so.70)
    at java.lang.System.loadLibrary(libgcj.so.70)
    at gnu.java.awt.peer.gtk.GtkToolkit.<clinit>(libgcj.so.70)
    at java.lang.Class.initializeClass(libgcj.so.70)
    at java.lang.Class.forName(libgcj.so.70)
    at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)
    ...9 more

    When trying with the robocode-setup-1.3-Beta.jar it installs fine, but when i try running robocode.sh i get this:
    pinky@pinky-laptop:~$ sudo /home/pinky/robocode/robocode.shUsing robohome /home/pinky/robocode
    java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit
    java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit
    at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)
    at java.awt.Font.tk(libgcj.so.70)
    at java.awt.Font.getPeerFromToolkit(libgcj.so.70)
    at java.awt.Font.<init>(libgcj.so.70)
    at javax.swing.plaf.FontUIResource.<init>(libgcj.so.70)
    at javax.swing.plaf.metal.DefaultMetalTheme.<clinit>(libgcj.so.70)
    at java.lang.Class.initializeClass(libgcj.so.70)
    at java.lang.Class.initializeClass(libgcj.so.70)
    at javax.swing.plaf.metal.MetalLookAndFeel.createDefaultTheme(libgcj.so.70)
    at javax.swing.plaf.metal.MetalLookAndFeel.<init>(libgcj.so.70)
    at javax.swing.UIManager.<clinit>(libgcj.so.70)
    at java.lang.Class.initializeClass(libgcj.so.70)
    at robocode.Robocode.initialize(Unknown Source)
    at robocode.Robocode.main(Unknown Source)
    Caused by: java.lang.UnsatisfiedLinkError: libgtkpeer: libgtkpeer.so: kan inte öppna delad objektfil: Filen eller katalogen finns inte
    at java.lang.Runtime._load(libgcj.so.70)
    at java.lang.Runtime.loadLibrary(libgcj.so.70)
    at java.lang.System.loadLibrary(libgcj.so.70)
    at gnu.java.awt.peer.gtk.GtkToolkit.<clinit>(libgcj.so.70)
    at java.lang.Class.initializeClass(libgcj.so.70)
    at java.lang.Class.forName(libgcj.so.70)
    at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)
    ...13 more
    Goodbye!

    In both cases it says something about "libgtkpeer". I have libgtk 2.0 installed, and when i try searching in synaptic for libgtkpeer i get nothing. So, what's wrong?

     
    • Amadeu Vilar Filho

      I was having the same problem... I installed "libgcj7-awt" and got the same as robopinky, (core dumped).
      Installed "1.3.1-Alpha" and nothing worked...

      I sarted looking for and found a blog where this guy, Dave, gives tips about configuring the sun's jre 1.6 in Feisty.

      Here it goes: http://www.daveshuck.com/blog/index.cfm/2007/2/7/Installing-Java-6-16-in-Linux

      The shortest way is to use "Synaptic" to get the package "sun-java6-jre" and then the command "sudo update-alternatives --config java" Just select the sun's java as default and try robocode.sh again.

      It worked for me...

       
      • Flemming N. Larsen

        I have now installed Ubuntu 7.04 on my Labtop. I just installed the Java JRE/JDK 1.5.0. I got exactly the same error like you guys.

        I solved it just by writting 'sudo update-alternatives --config java' like you mention, and then I chose the Sun implementation.

        This works! You don't need anything else! Whenever you install a new Java version you should run the command above. ;-)

         
    • robopinky

      robopinky - 2007-05-07

      Ok, i got rid of the initial errors when trying to run the 1.3-Beta by installing a package called libgcj7-awt.
      Now it tells me this instead:

      Using robohome /home/pinky/robocode
      No robocode.properties, using defaults.
      Aborted (core dumped)
      Goodbye!

      Suggestions?

       
    • robopinky

      robopinky - 2007-05-07

      I get the same message when trying to run the 1.2.6A version as well. (Though the installation works fine now that i added the libgcj7-awt package)

       
    • Flemming N. Larsen

      Hmm.. I don't know what causes this problem. It seems like a lot of guys have problem running Robocode on Ubuntu - especially with the AWT. It seems to me like the Java implementation is quite buggy on Ubuntu. Unfortunately, I don't know how to fix this.

       
    • Flemming N. Larsen

      Hmm.. have you tried the 1.3 Beta 2 (or newer if available)? I have fixed one issue, where the Swing thread was not granted file permission. I cannot tell from your stack trace, if it is due to the missing file permission, but it could be the reason.

       
    • Flemming N. Larsen

      I made a fix that might solve your problem. The fix is available in the Robocode 1.3.1 Alpha (not an official release) here:

      http://robocode.sf.net/files/robocode-setup-1.3.1-Alpha.jar

      Please tell me if this solves your problem?

       
    • Flemming N. Larsen

      Thank you for sharing this information. I am wondering if I could do anything in Robocode in order to overcome this issue. Good ideas are very welcome!

       

Log in to post a comment.