One nice thing about Java is that it is portable. You can compile an application on Windows and run it under Linux, or whatever OS Java has been ported on.
While it is pretty nice, it is sometimes misused: people develop on one OS an application that is only going to run on another one in production.
And while it works, there is still big differences in both OSes, and to do some things, you then have to know how to do them properly in both OSes.
The thing is, if you are a baby Java developer that has only ever developed under Windows, are you going to be aware of the specifics of Linux enough to write production code?
Answers itself pretty easily doesn't it?
You have to have a deep understanding of the target platform you are coding for, we will all agree on that. And the only solution for this is for you to code under the same OS your code will run in production.
Let's be more extreme: my friend Amaury makes his team use Ubuntu Desktop for coding, and uses Ubuntu server for production. And I think it is the way to go: I'm sure by now his team knows the distibution inside out.
It enables them to write more maintainable code (ever tried maintaining a config file for Windows and one for Linux? A nightmare), as well as better code because they are proficient at using their production platform's OS.
Working all day long under your target OS is the best way to learn about it, and certainly the fastest.
The most annoying thing is that sometimes the dev have to stay under Windows because of some kind of dumb reason such as the mail server of the company being Exchange. In that case they are solutions. VMWare for example, or simply Evolution.
For the sake of clarity, let me take an unrelated example.
What is the fastest way to learn a language? You got it: living in the country. And you'll end up speaking like a native.
That's what I want.