This blog has moved!

If you are not automatically redirected to the new address, please direct your browser to
http://www.juxtaservices.com/blog/
and update your bookmarks.

Wednesday, December 20, 2006

Edgy Eft + XGL + Beryl + Java App = Crap

I have been using Zend Studio for all of my PHP development, pretty much ever since I started working at Doba. As an IDE I find it sub par when compared to Eclipse, my previous IDE of choice, but its remote debugging capabilities are pretty reliable and simple to setup when compared to the PHP plugin for Eclipse (as of a year or so ago when I was playing with it). Supposedly, Zend is supposed to be merging its code with Eclipse so maybe someday we will get the best of both worlds. At any rate, I have found the debugging in Zend and its integration with the server side plugin, to be invaluable when trying to solve tough defects.

I previously had Zend Studio installed on Dapper Drake, and it was fairly easy to get it working, so I figured the same would be the case when I reinstalled Edgy Eft and got Beryl running on it. That's what I get for assuming. I was in for a few surprises.

The first issue I encountered was that the Zend binary for Linux was not finding the proper libraries (most of them libc.so.6) when trying to install in Edgy Eft. A quick search found this article on the Zend support site, which seemed to solve the problem by doing the following to the installer binary:

$ cp ZendStudio-4_2_0.bin ZendStudio-4_2_0.bin.bak

$ cat ZendStudio-4_2_0.bin.bak | \
sed "s/export LD_ASSUME_KERNEL/#xport LD_ASSUME_KERNEL/" > \
ZendStudio-4_2_0.bin

$ rm ZendStudio-4_2_0.bin.bak
This allowed me to execute the installer without the missing library issue, but I soon discovered another problem. Now I was getting an error in finding the JRE. I found this posting that showed how to bypass the JRE that is supposed to work with the installer and instead use the one on my system locate in /usr/bin/java. The command to run the installer is as follows:

$ ./ZendStudio-4_2_0.bin LAX_VM /usr/bin/java

Once again, I thought I was in the clear with this one in place, especially when I ran it and the installer seemed to fire up. I was beat down yet again however! Now in the Java swing window that appeared, there was a message saying that the JRE could not be found! Doh! To solve this I went through and installed the J2SE:

$ sudo apt-get install sun-java5-jre sun-java5-plugin

And also the JDK:

$ sudo apt-get install sun-java5-jdk

$ sudo update-java-alternatives -s java-1.5.0-sun

Move /usr/lib/jvm/java-1.5.0-sun to the top of the list in /etc/jvm
Finally the installer was successful when running the installer with the local JRE, and seemed to install successfully. Woohoo!

Crap! When I fired up Zend Studio everything inside the window was gray! What now!? I was able to locate this vague description of the problem, which is apparently due to the lack of support for XGL rendering in older versions of Java, but as you an see from the posting, it is unclear where to place the fix in the ZDE executable (the executable file to start Zend Studio). Well, since the posting was talking about Zend Studio 5.5, I decided I would try installing that and see if line 1695 in that version's ZDE made sense. Alas it didn't, so I decided it was time to get down and dirty, so I dug through the file until I found a good place for it.

Since the addition was to add an option that would use Sun's AWT toolkit when executing the Zend Studio app, I searched the file for the first instance of options, figuring I could add the specified line (options="$options -Dawt.toolkit=sun.awt.motif.MToolkit"), right after the options variable was declared, thereby ensuring that it would always end up in the execution command. I found the first place where it was declared just after this comment section:

####################################################################################
# Determining VM invocation options to use
#

#
# Verification
#


On line 1236 (please don't assume this to be the line where you should stick it), I placed the following command:

options="$options -Dawt.toolkit=sun.awt.motif.MToolkit"


Lo and behold, It finally works! After all that, I think I am going to contact Zend and charge royalties for fixing there broken crap software.

3 Comments:

Blogger StuTheWise said...

You are totally geeking me out man! Merry Kwanzaa dude.

2:53 PM  
Anonymous Anonymous said...

Yay you rock!

11:21 PM  
Anonymous Anonymous said...

Good job mate, I'm literally jumping on my chair full of joy haha. Been using Zend Neon but I can't get used to it, good ol' 5.5.1 does the trick :D

2:44 AM  

Post a Comment

<< Home