The Source for Java Technology Collaboration
User: Password:



Eitan Suez

Eitan Suez's Blog

Java Development on MacOSX Pretty "Swell" to Me

Posted by eitan on November 15, 2004 at 10:36 AM | Comments (9)

There have been a number of threads and discussions on Java development on macosx. I'd like to relate my personal experiences in case it's of interest to anyone.

Preliminaries

Allow me to begin by giving a quick outline on the nature of my programming work:

  • I work on a small workgroup business application with a backend database
  • The technologies and APIs I use include: J2SE, Swing, Hibernate, Java Web Start
  • I develop on macosx (both client and server code run on the same powerbook g4), and
  • deploy to a Linux server and primarily to Windows clients

Next, my primary development tool choices are:

  • IDE: Eclipse w/ revised key bindings
  • For builds, I use Ant
  • The Bash Shell
  • Postgresql DB
  • For source control, I recently switched to (and am very happy with) Subversion
  • For javadocs, I run my own dear tool 'ashkelon' on top of a local copy of Tomcat 5
  • And I still use vi..

I rarely find tools availability a limitation. That is, I don't feel that because I run a mac, that I'm somehow limited to using specific tools.

There has been one occasion where I had to switch to using a windows machine for a few days to do memory debugging work.

I had decided to work with a trial version of Quest's JProbe, which does not come in a macosx flavor. That's not to say there are no tools for memory debugging on the mac. But it does show that not all Java tools vendors out there have become macosx friendly (yet). For most APIs there's no OS issue. In terms IDEs, the number of choices is pretty good: Eclipse, IntelliJ, Netbeans, and XCode are all sensible alternatives. Lighter solutions such as vi, emacs, or subethaedit are there as well.

Some of you may not know that there exists a package for macosx called Fink, which makes a variety of Linux software distributions available to macosx. That includes X applications. With Fink I can run Gnome or KDE desktops and various Linux apps concurrently, alongside macosx. What I personally find nice is that I have the choice of building from source or of downloading prepackaged binaries.

General Niceties

1. What i like about working on a mac in general is the philosophy that the software subservient to the human, and not the other way around. On some other OS, the first experience one has after booting up is being disrupted by a barrage of requests from various software applications needing the immediate attention of the end user:

  • Your license for x is about to expire in y days, what would you like to do?
  • Security updates available, should I donwload now?
  • Please register your blah
  • New virus definitions available
  • Program x is attempting to do y, should I let it?
  • ..

What's interesting is that these requests are important only to the various applications making the request, and not necessarily the other way around.

At the same time, a bunch of programs such as virus checkers and firewalls hum in the background or display progress dialogs. To me, that's not the way to start the day. A person needs to be able to focus on their work; they don't need distractions (see jef raskin for more on this).

So the first thing you do is have to answer questions about things that are not your priority at the moment. Then you scratch your head and ask yourself: what was it I turned on this computer for in the first place? .. and it's time to go to lunch. :-)

2. This reminds of me another general feature I really like about the mac: I'm almost never in a situation where i'm waiting for it to boot up. My Powerbook G4 has been in sleep mode for most of its life and I just flip open the screen, enter my password, and start working.

The importance of Consistency, and dealing with it on macosx

The pragmatic programmer says: learn one tool but learn it well. That's very true. On the other hand, Dave Thomas was probably among the first to don a Powerbook G4. Who said that you can't use the same old tools on a brand new OS?

I think a most sensible choice in terms of tools selection is to pick ones that are "OS neutral." That is, tools that are essentially the same, no matter what OS you run. jEdit, Eclipse, vi, emacs, Google, Firefox all fall under that category. It's important because it means you won't have to learn new tools if for some reason you have to work on a different OS.

Java also falls in that category. The caveat with Java is a lag of a few months to get the latest release of J2SE. So on the mac right now J2SE is at v1.4.2_05. J2SE v5 is expected around Q1 or Q2 of 2005. I can see how this can be a big deal to some and no big deal to others. Luckily for me, I fall in the latter camp. We've already had a number of discussions on this issue on java.net and I won't belabor it here.

There are a number of adaptations and enhancements that go into "porting" J2SE to the mac, and I am by no means an expert in this area. One small but cool feature in J2SE for the mac is that if you run a Swing app in MDI mode (JDesktopPane and JInternalFrames), minimized JInternalFrames are given an effect similar to minimized apps on your macosx desktop: their icons are snapshots of the actual frame (that is, if you use the default platform look and feel).

There are certain concerns however that are OS-specific. Each OS has its philosophy on UIs and publishes interface design guidelines that "all good apps" should adhere to. One aspect of these guidelines is how one interfaces with editors. I've had to adjust to essentially letting go of my precious 'home' and 'end' keys in favor of another mechanism that uses combinations of 'Command', 'Option', and arrow keys. But it's sensible enough once you learn it. The dilemma I ran into is that I wanted to have the same basic key bindings for all my editors on the mac (to prevent me from going crazy) from TextEdit to jEdit to SubEthaEdit to Eclipse. So i had to break down and take a little time to adjust my jEdit and Eclipse key bindings to match TextEdit and SubEthaEdit. (In truth I primarily use three editors: vi, Eclipse's Java Editor, and SubEthaEdit).

Input Methods

One other thing that's very intriguing is the difficulty I had in getting used to the powerbook keyboard. I won't tell you how many times I openly cursed my keyboard during my transition period to the mac. The intriguing part is that my opinion has changed 180 degrees. Once you get used to it, it's a wonderful keyboard. It's noticeably lighter on the fingers (i.e. you don't have to apply too much pressure on the keys). The bottom line is that there are minute differences across keyboards which break old habits and force us to develop new ones. So in a small way, I am now locked in to the powerbook g4 keyboard. The same goes for the trackpad. I really hated it at first. Now I'm ok with it. I still favor an external USB mouse and plug one in about 99% of the time.

A related issue is that of keyboard accessibility in General. I'm a big fan of doing everything from the key board. I don't really like mice. I still think that other OSs are better at this than the mac. One thing I'll never get used to is navigating my source tree in Eclipse (not Eclipse's fault, mind you; Eclipse uses native widgets). Typing the first letter of a file or directory will not cause the focus to switch to that file or directory node in the tree. That is most annoying. Yes, it's true that macosx is better than any of its predecessors in terms of keyboard accessibility. But compared to its competition, it's still lagging. Yet, I've found ways to avoid using the mouse for 90% of my work. That's pretty good.

Summing Things Up

I'm personally very happy with my choice of OS and tools for software development.

If you're considering switching to macosx, I won't lie to you: for me there was a severe adjustment period. You will be less productive for some time while you break lots of old habits and form new ones. It's not easy especially for those of us who are older. I recall how easy it was for me to learn new things in my twenties. It's more difficult for me now in my thirties.

Let me provide an analogy here because it's not all bad news. Actually, it's as much good news as it is bad news: learning a second language is difficult. Actually so difficult that most of us spend most of our lives knowing only a single language. Are there benefits to being multi-lingual? You bet! I'm not sure if qualifying for a job at the UN should be considered a benefit of being multi-lingual. But on the other hand, the insight you get into the general concept of languages, having access to other cultures and communities, being more agile and versatile are all absolutely terrific benefits. You discover other ways (possibly radically different ways) of doing things. And that's what I find fascinating about life in general. Are there other solutions to a problem?

Overall, I find macosx to be a mature platform for doing Java development. Not only is J2SE available for macosx, but the various APIs that run on top of it are available, lots of Java tools run on macosx, and the same goes for servers such as Tomcat or JBoss. So all the prerequisites have been met. Add to this the mac-specific aspects of computing and interfacing with your system, unix-specific aspects of computing and interfacing with your system, and you've got a wonderful machine. It doesn't actually stop there, the Apple hardware is really nice and is just as crucial in making the whole experience an enjoyable one.


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • I too am on a Mac doing Java development. It's really great. Although, I've come across one major drawback to using Eclipse. It seems that none of the plugins for eclipse, like JasperAssistant and most of the modeling tools won't run. They all rely on the Java2D api which uses the AWT api. It seems there is some sort of conflict between SWT and AWT in the IDE that has something to do with which is running on the default Thread.
    I can't find a resolution to this problem and it's going to be a major problem very soon. If you've resolved this I'd love to know how.

    Posted by: leiby on November 16, 2004 at 06:39 AM

  • I agree with you on using a mac for work. I, myself switched to mac os x about one year ago and gave up on windows (after almost 20 years) because of all those distractions of updating, virus notifications, spyware etc. So I went out and got me a Mac Powerbook G4 (not an easy step for a windows guy) and this is the best computer I ever spend money on. I develop using java and eclipse and it is a blessing. As you mentioned, this OS never stops running, no reboots. This OS rocks.

    Posted by: ohpreis on November 16, 2004 at 06:57 AM

  • Yes, OS X does rock. I use Eclipse and the MyEclipse plug-in without issues. I don't do Swing, so I haven't seen the issues leiby experienced. Just look around at developer conferences and see how many developers are using Powerbooks. JDOM works great there as you would expect. I'm sold. My site was authored and deployed solely on Macs.

    Posted by: dshade on November 16, 2004 at 08:37 AM

  • Don't forget Linux. ;-)

    It runs on the PC you already own, you can pick a window manager that suits the way you work, and Tiger runs on it now. :-)

    Still, OS X is great. Given a choice between using Windows and OS X, I'd pick OS X any day.

    Posted by: afishionado on November 16, 2004 at 09:16 AM

  • As a follow up, here's the eclipse bug I was referring to. I'd like to suggest that people vote for this bug to get fixed. It's really a shame that there are a large number of plug-ins that won't run on the mac as a result.

    https://bugs.eclipse.org/bugs/show_bug.cgi?id=67384

    Thanks, Carl

    Posted by: leiby on November 16, 2004 at 01:54 PM

  • I tried using OS X for a few months, and indeed it was more enjoyable than using Windows (particularly Windows XP). However, the lack of keyboard shortcuts drove me crazy. What drove me even crazier was Apple's sanctimonious attitude. "Our interface is flawless. We have better accessibility support than any other OS. If you don't recognize that, you are an idiot." I finally realized that under OS X I was a sharecropper, and moved on to Linux. No virus headaches, no reboot headaches, keyboard shortcuts for everything, and of course, a current version of the JDK.

    Posted by: cayhorstmann on November 17, 2004 at 10:16 AM

  • Oh, come on Cay. We are all developing Java. Apple doesn't have the power to raize the land we're on. I tried desktop Linux and spent a long time on it. It sucked. No anti-aliasing on fonts? Hello? Eventually, if you don't mind spending half your time as a sys admin, you can get Linux to do what you want. Don't get me wrong, I hope desktop Linux does eventually rise: I predict MS will lose the desktop eventually. But for now, OS X is the best OS period.

    BTW, that sharecropper argument is absurd. The Linux community is donating tons of time and effort to software that the biggest, greediest corporate barons are using more and more so they can suck even more money out of the economy. But because we are feeding the beast from a position where we own the turf under us, we are free? Sounds like the father in Woody Allen's Love and Death talking about developing on his piece of land (a square of sod he carries around).

    Posted by: robwms63 on November 21, 2004 at 12:53 PM

  • You mention that some keyboard shortcuts doesnt work. So does CTRL+SHIFT+T work on Eclipse on OSX? I wouldn

    Posted by: anders on February 10, 2005 at 02:36 PM

  • I would not survive without it...

    Posted by: anders on February 10, 2005 at 02:37 PM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds