Thursday, May 1, 2008

Google Web Toolkit in an Linux 64-bit environment

I have started to take a closer look at Google Web Toolkit (GWT). It looks very nice giving me the possibility to debug AJAX-clients and removing the need for quirks for different browser (read MS IE).

Unfortunatly GWT is only shiped as 32-bit and I am running a 64-bit Ubuntu 8.04. The SVN-repository of GWT include some pre-compiled libraries which are compiled for 32-bit Linux.

The easy way is to download and install a 32-bit Java from Sun. Following the GWT getting started got me up and running. But I wanted to use my usual Eclipse in 64-bit version.

So I started Eclipse and imported my lab project according to the instructions. Then it was time for some settings.

First, add the 32-bit Java as an JRE to Eclipse:

  • Open the Window menu and select Preferences.
  • Select Java and then Installed JREs in the tree menu to the left.
  • Select add and pointed out where you installed your 32-bit Java and closed all the dialogs.
Now its time to connect the GWT-project to the 32-bit Java.

  • Right clicked on your imported GWT-project at select Properties.
  • Chose Run/Debug settings and then the only existing launcher for the project and finaly edit.
  • In the new dialog that show up; select the JRE tab. Click on Alternate JRE and select your 32-bit java in the drop down.
Click now on the run button and check that everything works.

15 comments:

Bruce Johnson said...

We're working on some big improvements to GWT hosted mode that will make everything work properly as true 64-bit. Additional, these changes will provide a lot more flexibility regrading which browser you use as you're debugging in hosted mode.

Magnus Runesson said...

Bruce, that sounds very nice.

Jon Gorrono said...

Thanks for the help with this. I found this after search. Thought I would pass on the thanks.

One additional change I had to make for Fedora 8 was to install libstdc++.so.5 to get the hosted browser to work.

Jose J. García Zornoza said...

Magnus, thanks for the tip.

resiros said...

It didn't work for me, gwt run'sok,but no hosted mode:
** Unable to find a usable Mozilla install **
You may specify one in mozilla-hosted-browser.conf, see comments in the file for details.

Anyone knows a solution, I tried downlading 32bit Librarys for mozillat and swt but nothing changed.
I'm also with Ubuntu 8.04 and GWT1.5.3

mattw said...

thanks for this, Magnus

Roland said...

Thanks a lot! Really helped me out!

Taylor said...

++1! This was the third solution I found, and the only one that worked.

Thanks!

baschde said...

Thanks a lot!

123 123 said...

Nice story as for me. It would be great to read a bit more concerning this theme.
BTW check the design I've made myself High class escort

Jon said...

@123 123: um....I am sure it's very nice but no.

Rogério said...

Magnun, thanks for the tips posted.
I did configure my environment as you mentioned and had to install libstdc++.so.5 in 9.10 Ubuntu's version. Had to point the LD_LIBRARY_PATH environment variable to the mozilla-1.7.12 directory in GWT distribuiton before start.
But, when I ran hosted mode in my Eclipse Galileo I got an error saying that my 8080 port is not available because another app is running on it.
Have you a tip for something like this?

Hugs,

Rogério Valente

Magnus Runesson said...

Rogerio, it sounds like you have som other software running already using port 8080.
Run in a shell:
lsof -i:8080
It will show you what software already using the port.

Rogério said...

Hi Magnus,

Thanks for answer me. I found an error in Run/Debug of the configuration of my Eclipse Galileo. The option "Run built-in server" in "Main" tab was checked. I just uncheck the option and run my application.

Thanks.

Cheers.

Paket said...

Thank you very much, i can run GWT in Windows 7 only i have to clic in my project then in the run menu at the top and i selected run configuration and then i follow your instruccions,

that was very useful thanks