Google Web ToolKit on Jaunty 64 bit

Post by: bingorabbit
Published on June 19th, 2009
Filed under: Google, linux, web
Tags: , , , , ,

Recently, I have became a big fan of Ubuntu, this system is really great, I admit I had some time to get used of it – especially with the sudo command -, but I love it! For some reasons, I have been introduced to Google Web ToolKit today, and it’s the first time for me to give it a try, and I should admit this too, Google, you rock!

You can run your projects in mainly two modes of operation using GWT (Google Web ToolKit), Web Mode, where should your final project files get compiled and placed after testing them using the Hosted Mode, and here came my problem.

Google Web ToolKit is working mainly on 32bit architecture and had it’s libraries especially those related to the Hosted Browser in the Hosted mode compiled on this architecture, so it doesn’t support 64bit architectures except with some workarounds. I have been searching for almost 3 hours, and I said I should be stating this for the record to help someone searching for the same topic later.

To get the hosted mode working on your 64bit system, first go and install ia32-sun-java6-bin package, on ubuntu, you can use Synaptic Package Manager to do so. This is Sun’s 32bit JRE, with its 32bit libraries and binaries. Then issue the following command:

sudo update-alternatives --config java

you should now be seeing this:There are 2 alternatives which provide `java’.

Selection    Alternative
-----------------------------------------------
*+        1    /usr/lib/jvm/java-6-sun/jre/bin/java
2    /usr/lib/jvm/ia32-java-6-sun/jre/bin/java

Press enter to keep the default[*], or type selection number:

As it may look, I have two JREs here, the 64bit one, which I usually use for my daily java development and the 32bit version that we have just installed. Type 2, or the one corrsponding to your ia32-java-6-sun installation and press enter.

By then, you will be able to run your application in the hosted mode with no problems.

..or you may would like to check other posts that can be useful..

  1. Ubuntu Jaunty Jackalope 64bit and DestroyTwitter
  2. 7 Google Wave Extensions I use
  3. Google & Yahoo Crawling
  4. Google Chrome
  5. Google Calendar, Now Offline

4 Responses to “Google Web ToolKit on Jaunty 64 bit”

  1. Taylor says:

    I tried your workaround and am still getting an error trying to start GWT in Hosted mode: wrong ELF class: ELFCLASS32

    If I switch to the ia32 version and shut down eclipse it will not restart (presumably because it is now in 32-bit mode). Any suggestions?

  2. Taylor says:

    Yep, and it’s a brand new Jaunty install. I ended up solving it by incorporating the 32-bit jre into the project:
    http://theworldofapenguin.blogspot.com/2008/05/google-web-toolkit-in-linux-64-bit.html

    It would be cool to be able to run it purely in ia32, though.

    • bingorabbit says:

      You can’t imagine how would being able to run it purely in ia32 would have helped me in my graduation project, I had to compile it everytime I need to check my application, as netbeans, didn’t support debugging in hosted mode on 64bit architecture.

Leave a Reply