Developing Java on my Mac

I recently made the switch from PC to Mac after many years of Windows and even DOS before that. So my overall opinion on Mac is good. I have however run into some issues doing some simple Java development.

First issue: There is no publicly available JDK from Sun for the Mac. Apple packages a special version of the JDK with OS X and us Mac users can only get Java updates from Apple and not Sun. What does this mean, at the time of writing I’m currently using Java build 1.5.0_13-119 which is some version of Java 5. Not the end of the world but Java 6 has been out for a while and who knows when Apple will release their version. It’s still better than being stuck on Java v1.4.2. I bring this up because at my job I’m doing a project that’s targeted to run on WebSphere v6 which is a kick ass server but only runs Java v1.4.2. If the Mac had limited me to v1.4.2 I would be quite annoyed.

Second issue: Eclipse kind of sucks on OS X. If you’re a Java developer you’ve probably used Eclipse. For personal development it’s generally first choice, or should I say my only choice. So I decided I wanted to screw around with a web idea I had (sorry that one’s confidential, I’ll tell you about when I make millions of dollars off it). So I got Eclipse Europa up and running and what do you know, it looks a lot like Eclipse on the PC except the SWT widgets which are OS X style instead of Windows. So far I like it. In general the keyboard shortcuts work the same. First I just made a simple Java project and did some “Hello World” type of programs just to see how Eclipse handled itself. No problems yet. Web applications… well that was just a whole other story. I started my little web application and was just playing a form page. Got Tomcat 6 up and running. Now maybe 30 minutes in or so I did something, don’t remember exactly what, I think I just opened web.xml and then the beach ball showed.

If you’re unfamiliar with Macs and OS X well there’s this thing we call the beach ball. It’s sort of the equivalent of the hour glass on Windows. It’s this multicolor circle thing that spins and looks like a beach ball. The first few times I saw it I said “hey that’s pretty cool, much nicer than that plain hour glass”. But that wears off fast, and it’s just as annoying as the hour glass because it usually blocks the system until it’s done whatever it’s trying to do.

Soon enough the beach ball disappeared, but so did Eclipse. Yeah it just crashed on me with no error message other than the standard OS X “some program just crashed” message. Not much help. I checked the Eclipse log and saw a bunch of crap I didn’t feel like looking at. So I tried it again. Not long after, it crashed again. This happened a few times. I considered opening an Eclipse bug but then I remembered how annoying bugzilla can be so I didn’t bother. I kind of want to smack whoever came with the phrase “Zarro boogs found”. If you’ve ever used bugzilla you may know what I’m talking about.

I figured I’ll just try making a new workspace and that will fix everything. See I used to work for IBM support, specifically RAD/WSAD which is built on top of Eclipse. You wouldn’t believe how many times creating a new workspace was a solution. Not a very convenient one but it usually fixed a lot of the inconsistent problems. It didn’t even work for me in this case. So end of the story is that Eclipse like to crash a lot on my system. I was over on the macrumors forum and some people say they’ve had no issue but there were a few that agreed Eclipse was a bit problematic, at least on Leopard (latest release of OS X… the one I’m running).

I decided to give Netbeans a try. So far it hasn’t crashed on me. So far I like it. Never did much work with it but heard good things. It has similar features to Eclipse. I’ve been able to get going with Netbeans. The only problem I ran into was getting Tomcat running via Netbean, better yet through the terminal. I’m not 100% sure but I think Eclipse either has its own startup scripts or hooks directly into the Tomcat runtime JARs and therefore requires 0 configuration from the user. Netbeans uses the ‘catalina.sh’ script and was complaining about not being able to execute it. So I opened up the terminal to see for myself and sure enough I didn’t have the correct permissions. After setting the startup script permissionsĀ  to 755 and trying again it was giving me some warnings about environment variables not being set. I looked at the script and saw it was calling some other scripts. So eventually I just did a ‘chmod 755 *’ and then it all worked just fine.

So in the end looks like I may just have to get used to Netbeans and I’ll be developing away on my Mac.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: