Skip to main content

Upgrading to Eclipse Galileo

Posted by cayhorstmann on June 26, 2009 at 9:54 AM PDT

I just installed Eclipse 3.5 (Galileo)—it seemed a more attractive
thing to do than actually getting my work done. Fortunately, I only need three
Eclipse plugins right now. Here is how they fared with Galileo.

  1. The Scala plugin seems to
    work just fine, even though the plugin page ominously states “3.5
    Milestone releases are not fully supported”
  2. The Glassfish plugin
    works, but not in the same way as it did in Eclipse 3.4. In that version,
    you right-clicked on the Servers tab, selected New and then clicked the
    “Download additional server adapters” link. Following href="http://blogs.sun.com/arungupta/entry/glassfish_at_eclipse_demo_camps">this
    tip, I instead added http://ajax.dev.java.net/eclipse to
    the update sites, which is a much more sensible way anyway. I never
    understood why there was a separate mechanism just for server adapters.
  3. The Subclipse
    plugin
    also works as always. Actually, I tried the Subversive plugin
    first (which is a part of Eclipse), but it didn't pick up my existing SVN
    projects. I think this is because one has to download
    “connectors” from another site, as explained href="http://www.vogella.de/articles/EclipseSubversive/article.html">here.
    What's the point of having half of it a part of Eclipse? I guess I'll stick
    with Subclipse for a littler longer.

What did I have to show for my troubles? Not much, actually. Here are the
three improvements that I noticed so far.

  1. The icon now has a Java EE IDE banner, probably because
    people were always confused which version they had actually installed. Why
    they don't show it in the title bar is a mystery. Maybe in 3.6.
  2. The code formatter now has an option Never join lines
    that makes Eclipse not move code or comments to different lines. That is
    useful if you don't want Eclipse to make a hash of your carefully aligned
    array initializations etc. Of course, it also means that you then have to
    manually reflow your javadoc comments, which doesn't sound like a win.
    Maybe in 3.6, they'll give us separate options for code and comments.
  3. There is now an option to generate toString automatically.
    This is something I've wanted for a long time. Unfortunately, it is not
    very good. Core Java gives
    these simple rules for toString:

    • Use getClass().getName() to print the class name. Then
      your toString can be inherited.
    • When you redefine toString in a subclass, first call
      super.toString(), then add the subclass data.

    The Eclipse formatter follows neither of these eminently sensible rules.
    Maybe in 3.6.

Did I miss anything exciting? href="http://aniszczyk.org/2009/06/11/eclipse-galileo-review/">This and href="http://www.fleischle.net/index.php?option=com_content&task=view&id=19&Itemid=1">this
and href="http://eclipsesource.com/blogs/2009/06/24/eclipse-galileo-feature-top-10-list-number-1/">this
review didn't have anything that looked it would change my life. Not a problem,
of course. Eclipse is a great IDE and pretty mature at this point. If I could
wish for something, it would be better support for JSF and Scala. Maybe in 3.6.

Comments

User and Pass to connect to localhost

Hello, I have installed Eclipse Galileo RS1 for glassfish v3. When I start GF everything goes ok until the IDE ask me for the User and Password to connect to localhost. I do not know what are them. NetBeans 6.8 does not ask me for them. So how can I resolve this problem? Thanks in advance, Jose

Mateusz: Thanks for the tip. I settled on ${object.superToString} [${member.name()}=${member.value}, ${otherMembers}] I would strongly urge you to switch to ${object.superToString} as the default ASAP. The current default is just wrong when it is inherited, and it hides superclass information when the superclass has a nontrivial toString. The people who need this feature most are not well served with a bad default. Maybe it would be nice if there was a choice "${object.superToString} if the superclass is not Object, ${object.getClassName} if the superclass is Object". That way, one doesn't pick up the useless hash code from Object.toString. Then again, the hash code does not harm.

Hi Cay, I'd like to comment on your point about toString generator. I'm not sure you're aware of this, but it actually does allow you to use getClass().getName() and include super.toString(). It's all configurable with 'String format' template mechanism. Just edit the template and use ctrl+space to see what variables can be used. So maybe the default template is not perfect, but you don't need to wait for 3.6 to use the generator the way you like :) Please let me know if that helps or did you have something else in mind. I'm the main contributor of the toString generator feature and I love to hear what people think about it (and especially what they don't like about it).

Hey Cay, I got a problem to install glassfish plugin in Galileo. I have added update site "http://ajax.dev.java.net/eclipse". But i failed to download it. The error message is showed below: An error occurred during the org.eclipse.equinox.internal.provisional.p2.engine.phases.CheckTrust phase. session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.provisional.p2.engine.phases.CheckTrust, operand=[R]com.sun.enterprise.jst.server.sunappsrv 1.0.27 --> [R]com.sun.enterprise.jst.server.sunappsrv 1.0.28, action=). java.lang.NullPointerException

Anyone facing some slowing down when searching in files if one of the files is a big javascript file? I'm talking about a huge time, sounding like a bug, an issue not found in previous versions.

You can add Java 7 to Eclipse as an "alternate JRE". It works fine for me--the library changes are automatically picked up. Of course, if there are language changes, then Eclipse won't be able to deal with them until its parser catches up. Ditto for Netbeans.

Hi Cay, maybe I am missing something, but Eclipse 3.5 doesn't seem to support Java 1.7 in any way. For people that like to stay at the cutting edge, it's completely useless right now that Java 1.6 development is essentually over!

Thanks for your reply Gary. It does not work for me yet with JSP pages. But I now know that it is at intended to work, since it works for JSF. Does it also work for your EJB and EAR modules?

@Jelte: Hot-deploy works beautifully for me with Eclipse and Glassfish v3. In fact, it is quite a bit more reliable than with Tomcat. It's definitely a game-changer. Now this is with JSF 2.0 and facelets--I haven't tried it with JSP. @javafollower: It works for me. Try http://horstmann.com/corejsf/. That's where it gets redirected.

Hi Cay, I'm sorry if this is totally inappropriate but I please check your corejsf.com because it hasn't worked for several days now. There are (supposedly) bugs in the sample code and I'd like to inform them. Have a great day!

Hi Gary, Thanks for another nice down-to-earth article. I also find the usability of the subversive and the "download server adapter" quite dissapointing. To this I add that downloading server adapters is not always working from countries like China due to unstable network connections. So thanks again for finding the link for adding the GlassFish adapter manually! I do have a question: Does the GlassFish plugin for Eclipse work for you with hot deployment? This is for me the only reason to stick to Tomcat for development, while my production environment is GlassFish. When I save a JSP page I do not want to restart GlassFish, but I want GlassFish to recompile the page. And when I change a Java class I do not want to restart manually and log in again. It should go automatically, as long as your session contains only Serializable data. This trick works for years in Tomcat. Did you manage to make this work in GlassFish? Thanks! Jelte p.s. I know it works in NetBeans, but that does not help me :-)