gwt-maven-plugin updated to 1.2

The very handy Google Web Toolkit plugin for Maven has finally been updated in the respoitory to version 1.2.  At this point the docs on the website are still for v1.1 (actually 1.2-snapshot) from October.

But I can finally point at the official repo instead of using my own build in my projects.

It supports the new compiler options, and spits out those beautiful SOYC reports. The archetype doesn’t seem to have had any significant changes  that I can see (could be wrong), but it works just fine under gwt-2.0.0. I wish the default for gwtVersion was 2.0.0 though.

Thank you to the developers of the plugin–it makes working with the exciting new version 2.0 of GWT that much more easy.

JADclipse and Eclipse 3.5

JADclipse and Eclipse 3.5
Yesterday was the second time in as many months where I was really, really glad I had a decompiler handy. When you need a decompiler, it turns out, you really need one.
Despite the fact that it was written in 2001, Pavel Kouznetsov’s JAD decompiler is fast and works more than well enough. There’s an Eclipse plugin for it, JADclipse, which takes the JAD output and sticks it into the Class File Viewer.
Both of these projects are no longer maintained, as far as I can tell. The JAD website is gone, and the plugin update site for JADclipse doesn’t work anymore.
However, with a bit of searching, I came across this archive of JAD executables, and
Mike Schrag has graciously hosted update sites for JADclipse. JADclipse itself was created for Eclipse 3.3, but the plugin works with Eclipse 3.4 and I can confirm it works with Eclipse 3.5. Use Mike’s 3.4 update site and you’ll be just fine.

Yesterday was the second time in as many months where I was really, really glad I had a decompiler handy. When you need a decompiler, it turns out, you really need one.

Despite the fact that it was written in 2001, Pavel Kouznetsov’s JAD decompiler is fast and works more than well enough. There’s an Eclipse plugin for it, JADclipse, which takes the JAD output and sticks it into the Class File Viewer.

Both of these projects are no longer maintained, as far as I can tell. The JAD website is gone, and the plugin update site for JADclipse doesn’t work anymore.

However, with a bit of searching, I came across this archive of JAD executables, and Mike Schrag has graciously hosted update sites for JADclipse. JADclipse itself was created for Eclipse 3.3, but the plugin works with Eclipse 3.4 and I can confirm it works with Eclipse 3.5. Use Mike’s 3.4 update site and you’ll be just fine.

Update September 2010: Mike has symlinked in folders for Eclipse 3.5 and 3.6, but they are exactly the same as the 3.3 release of jadclipse.

P.S. — if you are having trouble with the install, be sure to Eclipse -clean as it suggests on the sourceforge JADclipse page.

Messing with Google Web Toolkit

Just a note. I’ve been working like crazy–and let me emphasize crazy–but I’m surviving okay. I think I will have to get my thoughts together on the topic of project management (some is better than none) and the ill effects of failing to plan and how to respond to the reality of too much work to complete before the pending deadline (hint–the answer isn’t to tell your team to work harder).

Let’s talk instead of happier things–this year’s peaches were especially delicious for some reason.

And in geek news, Google Web Toolkit is mighty interesting. I have finally got a few cycles at work to try to reskin one of our (mighty unsightly) admin apps, and I thought GWT would make a good fit. It does, and it is lots of fun.

Still, GWT on its own isn’t enough. While it’s relieved the pain for a backend developer who is not cross-browser Javascript savvy, it still is UI building. The sample apps aren’t practical for big applications (I’m not going to try to stuff the UI initialization for a 100+ page admin app into the onModuleLoad method).

So I am exploring some alternatives to managing the UI menu and objects. My current plan is to generate the menu from a YAML file. Easy to manage, easy to maintain. That’s the theory anyway.

Also a lot of buzz about using an EventBus to manage the UI wiring. Gonna try some of that tomorrow. Hopefully in a few days I’ll have this Struts1.2 app dressed up in some new clothes. More updates as I figure this stuff out.

Update: the developerlife.com website has a bunch of good GWT tutorials.

Why does my backgrounded script/app die after I close my terminal window?

Short answer: because you’re a freaking idiot.

Long answer: My shell script is on a Linux server. I access via ssh using Putty. I run it from the command line, from Window #1,  like this:

$ bin/myapp.sh &

when I close my ssh window. In Window #2, I watch the logs, and I can see that myapp.sh has exited. Specifically, it caught a SIGHUP.

How to fix this? Don’t close the window. Instead, exit from the ssh session by typing “exit”.

Short answer: I’m a freaking idiot.

Re: conversion to dalvik format failed with error 1

Yeah, a few quiet hours on the weekend and time to code.

I’m a little behind, but I’ve been thinking about mobile alot lately. So it was time to upgrade my Android SDK to 1.5.

First thing I do is upgrade the Android Developer Tools for Eclipse. Inside the Eclipse “Software Updates” wizard, I can see that I was using ADT 0.8.0, and the update site said that 0.9.2 is available. Everyone knows that it 0.1.2 better than the last version! So I do the Eclipse upgrade.

While that is going, I download the 1.5r1 SDK, and stick it in my java folder. Eclipse restarts, and I rebuild and >>BAM!<< error!:

conversion to dalvik format failed with error 1

Whoops. Apparently this has to do with some internal Eclipse stuff caching the old ADT 0.8.0 stuff, and the poor Android Tools getting confused. Silly Robot.

Restarting Eclipse with the -clean option fixed it for me. Apparently the correct way to upgrade the ADT is to uninstall the old 0.8.0, and install the new 0.9.2.

Hope this helps everyone out there. Happy coding!

P.S. Hey, WordPress is bugging me to upgrade to v2.8. Wish all upgrades were as seamless as the WordPress one.

good to be a Java programmer

It’s an exciting time to be a Java programmer.

That’s a big change of opinion for me. I started my career with interpreted languages (Usertalk, Python, Perl) and Java seemed really verbose and unproductive.  And it’s still verbose.

But a great set of tools make me really productive.The tool infrastructure  has come such a long way. Eclipse is a great IDE, and if you don’t like it IntelliJ and Netbeans are as good or better. And the ecosystem around the IDEs is incredible. I’m an Eclipse user, and I’ve talked in the past about Mylyn and how much better that makes me. The intellisense features make the huge Java APIs manageable, and the refactoring tools give me enough freedom to make significant code changes without worrying about copy/paste mistakes.

The tool chain for build, dependency management, testing, and continuous integration has improved. Ant is a great workhorse tool. Hudson pretty much the best CI tool ever, and I’ve even come around (slowly) on Maven. Maven, when it works, works really well. It is hard to imagine working on the project I am working on now without a tool like maven to help manage every aspect of the build.

Part of productivity is code reuse. There is a ton of great code (Apache commons, anyone) that has been battle-tested and debugged and often even documented available. Sourceforge and Google code and Codehaus and java.net all provide tons of libraries and tools.

Some of the best parts about Java is that coders have reacted violently against the unwieldly, badly designed APIs that where thrust upon us in the early days. Most coders knew enough to stay away from EJB, unless they were being paid the big bucks to inflict Big E enterprise on the masochistic companies that insisted on it. But a few coders also figured out alternatives: Spring and Hibernate being just two examples.  The fact that the community has been able to leave behind some of the mistakes and move forward–and that the driving force of that is open source driven, speaks well to the health of Java now and in the future.

It’s weird how the plumbing has become sexy. By far the most exciting development of the past two years is the growth of other languages on the JVM. And that is because the JVM and Hotspot JIT compiler is so good. And it means that I can build on my investment in learning Java, the Java tools, and my IDE. Learning a new language, and I get to keep my productivity gains in the toolchain and environment.

So now it’s time for my list of  reasons to be excited about Java right now. It’s been a busy time for Java geeks, with JavaOne last week, and Google I/O the week before, and Eclipsecon roughly a month ago.

  • Android — I can write mobile apps in a language I already know. whooo! It’s not as sexy as the iPhone, nor is it as crowded a place for a developer. And the mobile market is huge. I don’t mind being in a smaller portion of such a vast market.
  • New languages blooming on the JVM. JRuby is fantastic, and fast. I am learning Groovy now, which I expect to take my productivity up several notches. JPython and Scala are in view too.
  • New focus on graphics and desktop. JavaFX has a lot of challenges, and I’m not quite willing to invest yet, but I am watching closely. There are some really reasonable ways to do UI in Java or Groovy now.  And don’t forget Processing, and it’s focus on practicality, ease of use, and real world data crunching and visualization apps.
  • Google on Java. Wow, the presentations from Google I/O were a real eye opener. AppEngine will let me deploy a java web app with the push of a button. You can’t get easier or more efficient than that. Guice looks like DI I can believe in. And some of the lower profile stuff, like http://code.google.com/p/google-collections/, could wind up having a huge effect on my day to day coding.

Okay, if you’re still with me, thanks for reading. Bottom line, it’s a good time to know Java. The tools have matured, there is a lot of opportunity, and who knows? maybe even the Oracle acquisition of Sun will work out good as well.

Eclipse plus Mylyn = Productive

I tried Mylyn for the first time a year ago, and found it to be impressive, but the job I was working at had a relatively small team, and small codebase, and I was only using Eclipse/Java a portion of the time, so I found that I didn’t really use it too much. And after a couple of nasty crashes, I realized I had overloaded Eclipse with too many plugins, and yanked Mylyn out.

Now I’m working at a new gig, which is all Java all the time, and I am pretty much living inside Eclipse, flipping away only to check docs or go into DBVisualizer. And the code base is of a respectable size, divided into 50 or so source folders. My Package Explorer view just scrolls and scrolls and scrolls, and it is impossible to find anything. (Add to that that it is a new code base for me, and I just don’t know where stuff is, period.)

So suddenly, Mylyn is a lot more useful. It hooks into our issue tracker/ source repository (Trac/SVN). Which means I never have to leave Eclipse for information about what I am doing. I love the Planning tab on the tasks, where I can outline my approach to a problem, and which I can refer to when I lose track of what to do next.

My this is cool moment came when I discovered that Mylyn saved my workbench state for each task. Turning the task off cleans the workbench editor of all the files I had open—and making the task active again brings them all back. It’s fantastic to switch between issues, knowing that it won’t take you 15 minutes just to get everything set back up.

Best of all, Mylyn makes the Package Explorer usable again, by focusing me on just the files that I am using. I find Mylyn absolutely vital t o getting my job done these days.

One note: Getting started with Mylyn can be a little intimidating.  And for the first time user, the Mylyn project presentations are not especially helpful.  The 60 minute video done is a bit to long for the impatient to digest. There needs to be a simple 5 minute “here’s what’s cool, here’s how to get started”. If you are new to Mylyn, the best would be to get a demo from someone who has used it before. If you can’t get a live demo, I’d encourage you to stick with it though, it has definitely paid off for me.

a little preview

Work on the WordPress plugin continues.

WordPress is… well, it is a sprawling bit of code. But its not too shabby, and their are at least attempts at documentation. All these little bits of functionality crawling around.

Hard for me to be too hard on the WP guys, though. Some of their plugins are really easy to read. I’m fairly sure my current level of PHP code isn’t really ready for prime time. On the other hand, if we waited for prime-time, we’d never get anything released, would we?

Well, no code for download yet but here is a preview of what I am working on.

PHP and Character Sets

I’ve been trying to get WordPress’s post-by-email feature to work with image attachments. After a couple days of hacking (1.5 days of groping around in the dark, and half a day of hacking), I have mostly succeeded. 

Please hold your applause.

The catch is, it isn’t handling text in Japanese, posted from a Japanese cell phone. A minor inconvenience, but it happens to be my current itch, and I’m scratching it.

Turns out that PHP and its support for character sets is even worse than advertised. Here are some links and notes for my own future reference:

iconv is the old standby, but it doesn’t help all that much. MBstring looks like it will help me figure out what the current encoding of the string is.

Wish me luck while I figure this out.

UPDATE: MBstring works like a charm. Japanese phones use SHIFT_JIS internally but the email servers they use encode in ISO-2022-jp. And here is a nice lucid explanation of the Japanese encoding systems in common use: iso-2022-jp, Shift-JIS, and EUC-JP — although be aware that it is quite old, 1996, and predates widespread acceptance of Unicode.

Thoughts on WordPress 2.7

There was a release of the new WordPress this weekend, and it looks and performs great. I’ve been working on upgrading the blogs that I manage, and I am really thrilled about the fact that I’ll never have to do it this way again–2.7 includes a self-upgrade tool.

2.7 has support for Child Themes.  Here are some notes to myself as I attempt to develop some themes for friends:

  • Sample Blog data comes in handy for testing. More here.
  • RevolutionTwo.com offers their blog themes for a fee, but they are GPL’d so there are unsupported links on each of their theme pages. (I was a pretty happy customer of their 1.0 theme.)
  • Themeshaper has the low-down on child themes, because he wrote the spec for child themes that eventually got folded into 2.7. His theme “Thematic” seems to be the cats pajamas for a good place to start for theme development. (Thematic turns out to be rich and complex and based on stuff in the Sandbox theme’s post and class semantic markup.)
  • Some helpful info about the specific changes to themes in 2.7: ericulous and bloggingtips.

 

Strange how I’ve come around on PHP, and WordPress. But they both manage to hit a sweet spot for the projects that I want to do in my spare time, on my cheap (but awesome) hosting service. More on that another time.