I believe you can play the file with a midi player and record it as a wav as its playing. I think I remember doing this once, so I'm pretty sure it works.
If you were looking for a way to do it without actually playing it, I would probably start by looking at JMF: http://java.sun.com/products/java-media/jmf/
You type "convert midi to wav" into google
You browse the list of shareware software that will convert midi to wav "with a single button click"
You choose one or more, download them, try them out, and post the results back here so that other inquiring minds can know what works best.
> The problem is that I'm new to Java Media Framework
> so a code sample whould be very usefull
You like to be fed with a very small spoon it seems.
Here goes: if you open the link provided by RadcliffePike you'll see a menu on the left side of the page. In that menu there is an item called Code Samples & Apps. Click that menu item.
You can also put the following strings in your favorite search engine java jmf code example and hit the search button.
You would have to find a software only implementation of a Synthesizer. Register it and ask for it by name. Then you can cast the generic "Synthesizer" to the known type and tap into its sampled output.
Even better if it implments both Synthesizer and InputAudioSteam or TargetDataLine
I don't know if one exists but it could be worth looking for.
matfud