As with any other Java application, you compile the application before packaging and deploying it. With J2ME, however, you use the J2SE compiler and need to invoke it with the appropriate options.
In particular, you need to use the -bootclasspath
option to instruct the compiler to use the J2ME classes, not the J2SE classes. Do not place the configuration classes in the compiler's CLASSPATH. This approach will lead to run-time errors, because the compiler automatically searches the J2SE core classes first, regardless of what is in the CLASSPATH. In other words, the compiler will not catch any references to classes or methods that are missing from a particular J2ME configuration, resulting in run-time errors when you try to run your application.