views:

435

answers:

13

I have been given the option to either have a Windows laptop or a Mac laptop to do my Java development on. Before committing to one of these, I thought I would find out if there are any issues or benefits I should know about using a Mac laptop over a windows laptop?

One thing I did hear was that the Java JDK releases are not always the latest for Macs and you need to wait a while.

My environment is simple: Eclipse with Java EE 5.0

+1  A: 

There are(/have been?) certain problems regarding the UI frameworks. But generally it should work.

Also have a look at: http://developer.apple.com/java/

Patrick Cornelissen
+6  A: 

For your configuration, there's no problem... That's true that sometimes you have to wait for release but nothing really insurmountable... I got some issues with Eclipse, though. It crashes quite often but I'm doing intensive stuff...

One my issue was with the shortcuts, that sounds dumb but I'm a heavy shortcut user and switching between control and the apple keys and alt was sometimes hard to remember..

LB
+1 I was going to say the same thing. It's not dumb; we use these keystrokes probably thousands of times a day. I have Mac at home and Windows at work, and my fingers always have to adjust - for things as simple and frequent as getting to the end of the line, refactoring, etc. It's not deadly, but it certainly hurts.
Carl Manaster
You can swap their mappings in System Preferences if it really bothers you :-)
frou
but then you overwrite MacOsX shortcuts, I think...I've tried that and there were some conflicts that were not easy...
LB
Have you tried changing the eclipse.ini file to allow for more memory?As for the shortcuts, my gf has a Mac that I use quite often. Just tell her "I don't know hon, something is just wrong with my laptop" :-)
Ascalonian
+2  A: 

I have not found major problems working on Macs for Java development (I usually develop both in Linux and Mac platforms). Regarding the sdk it is true that they are released with a delay compared to the Linux/Windows versions.

You will find the latest jdk at the Apple Developer Connection, you will need an apple developer account (it is free). As an advice, keep the images you download from Apple as it may happen that after a period of time they are not available, specially for old releases.

Regarding swing development, I think the SpringLayout is processed a bit different (some springs missing) as some JPanels developed in Linux produce some warnings in Mac. JPanels developed on Mac work fine in other platforms.

Daniel H.
Thank you for letting me know. I use GridBagLayout as my layout manager. I also appreciate the link for Apple Developer Connection. Much appreciated.
Ascalonian
+2  A: 

Don't forget that you can still run Windows (either virtually or natively (via BootCamp)), so even if it came down to simply liking the machine better, the Mac is still worth considering.

frou
That is very true, but then my company would need to purchase a Mac laptop AND a copy of windows xp. I am afraid they wouldn't go for that, especially since the mac laptop is more expensive. If it was at home, I would definitely do that though. :-) Thank you for the suggestion.
Ascalonian
A: 

A benefit of the mac platform over the windows platform is the fact that you have a real terminal, that works. This helps immensity when you are deploying your code remotely.

Milhous
Well, you can get a real terminal in Windows too. Just install cygwin. First thing I do on any windows machine. :)
Herms
I have used cygwin, and it did not work quite as well as the Linux/mac termital ;-)
Milhous
+1  A: 

The only issue that I can think of from my very limited experience is that Mac OS X (10.5.x) uses as default library JVM 1.5 where the newest one is JVM 1.6 so in some cases, using new functions/classes from JVM 1.6, you would have to change it manually. It is very straightforward in Eclipse.

Project -> Properties -> Java Build Path -> Libraries.

Artur
Thank you for your reply! We actually are required to use Java 1.5 here. But I will keep that in mind if/when we upgrade to 6.0
Ascalonian
You can set the default JAVA on your system using/Applications/Utilities/Java/Java Preferences.app
Blair Zajac
+2  A: 

I use a Mac Pro for java development (Eclipse and Java 5) and Eclipse is quite unstable. May be its because of the 32 bit. I get Outofmemory errors all the time. I essentially run a Linux VM under VMWare Fusion and develop in it.

Rohit
I'm not sure about eclipse, but I know netbeans lets you configure the JVM's memory limits and I assume eclipse would let you do that too. Did you try tweaking that? It would probably help with the OutOfMemory exceptions.
Herms
I agree with Herms. I just change my JVM settings right in the eclipse.ini file. Of course, I do not know how this is setup in the Mac though.
Ascalonian
I did tweak everything that was possible. Here's the vmargs part in my eclipse.ini:-vmargs-Xdock:icon=../Resources/Eclipse.icns-XstartOnFirstThread-Xms1024m-Xmx1024m-XX:PermSize1024M-XX:MaxPermSize1024M-XX:-UseParallelGC-XX:-UseConcMarkSweepGC-XX:+AggressiveOpts-Dosgi.requiredJavaVersion=1.5-Dorg.eclipse.swt.internal.carbon.smallFontsAlso, anything above 1024M and eclipse crashes on start. I know I can give more memory to other JVM instances so its not a JVM problem but an Eclipse one. The recent Eclipse M* builds support 64 bit JVM on OSX I think.
Rohit
Err..the newlines got stripped.
Rohit
I use a Macbook (earlier Intel non Core-2-Duo) and I had a few problems with long hangs and memory issues (even after tweaking the Xms Xms etc), but I find that if you use the packaged options (eg. I use Jboss Developer Studio) then most of these go away.
Damo
+3  A: 

Could be of interest to know that Apple's support for Java 1.6 is only for the 64 bit intel architectures. If you are runnning a 32 bits cpu you have to be satisfied with 1.5

Schildmeijer
That works fine for me right now. My company can only use 1.5 at this point. There is talk to upgrade to Java 1.6. However, I think the Mac laptop is 64 bit. I could be wrong. Thanks!
Ascalonian
I've compiled JDK 7 for my 32-bit MacBook Pro.http://kingsfleet.blogspot.com/2009/03/building-jdk-7-on-mac.htmlhttp://infernus.org/2009/02/building-java-7-on-mac-os-x/I don't need a GUI, so this works nicely.
Blair Zajac
A: 

The google widget toolkit (GWT) development tools are also not completely supported; see GWT Getting Started guide.

As with eclipse the trouble often is in the SWT GUI bindings. They bind to java but are not themselves platform independent. You always have to hope that the bindings are correct for your platform (e.g. work as expected).

extraneon
A: 

For those stuck on OSX 32bit you can try SoyLatte if you need 1.6

+1  A: 

I frequently work back and forth between the two, and the only thing that occasionally bites me are the layout managers. They like to position components different among the OSs. Easy fix of course, but keep an eye on making mistakes.

Rev316
What layout managers have you experienced this with? I primarily use GridBagLayout with a little BorderLayout.
Ascalonian
+1  A: 

Eclipse on OS X works fine for me, and IntelliJ Idea seems good too (haven't used it on OS X myself, but know plenty of people who have). Also the Shark profiler that comes with the apple developer tools works fine with java apps (you need to add -XrunShark as a VM property), allowing you to attach at runtime without any hassle. Plus it's free, which is nice.

bm212
I really like the look of IntelliJ Idea... however, it isn't free like Eclipse. I will definitely look at the Shark profiler as well. Thanks!
Ascalonian