This is a tough question, and I'm sure one could come down on either side, but personally, I feel that you're better off learning before you come. I've done some reading on the subject, and it has been found that the best way to pick up a foreign language is not just total immersion in that language, but total immersion combined with a knowledge of the fundamentals of the language. Of course, if the only Japanese teachers available to you are substandard, then perhaps you shouldn't study with them.
According to what I read, when you jump directly into the culture and language without any base, you actually tend to pick up more bad habits because you don't fully understand the fundamentals of what's being said, so you make assumptions which are often incorrect. I think this can be seen in many non-native speakers who learned through exposure. While they make speak well, they often have a large number of fundamental mistakes in their speaking. That being said, if you study a lot once you get here, I'm sure you can avoid these pitfalls.
I'd recommend getting a book about the basic grammar and concepts of Japanese, and using some of the great online Japanese studying resources to help you confirm that you pronunciation is correct. I used
Easy Japanese when I first started learning. It's not the best text book, but it's interesting and will provide you with some basics. I also personally recommend the
Genki textbook series, if you're looking for more of that style. You don't need to be a Japanese master before you arrive, but it will give you a leg up if you have some idea about what your getting into before you jump in.
Also if you haven't already done so, pick up a book or study online the basic hiragana and katakana scripts. I'm sure you'll find these, especially the katakana, very helpful.
That's all just my opinion, but from what I've seen and read, it seems to be true.