Unfortunately it's not quite as easy as that. Java has different "profles" depending upon the type of device it's running on.
While the language is the same for all the different profiles, the supporting libraries will be different, because the different devices have different capabilities.
The two profiles will be most interested in are CLDC and MIDP, which stand for Connected Limited Device Configuration and Mobile Information Device Profile.
http://wiki.forum.nokia.com/index.ph..._Nokia_devices
Once you know what profile you're targeting, you can then use an IDE (Integrated Development Environment) to write your code, and then somehow deploy it onto your device.
To be honest, You'll get more information if you read the following
http://wiki.forum.nokia.com/index.php/Category:Java_ME