How to build MIDP 1.0.3 under Windows using Cygwin


Cygwin is a UNIX environment for Windows. It's located at

When running the setup program, in the 'Select Packages' dialog box, choose to install gcc2, gcc-mingw, make and mingw-runtime under the 'Category' field.

Install JDK 1.3.1

Install JDK 1.3.1 under cygwin's '/usr/local'. For example, if cygwin is install at 'd:/cygwin', install JDK at 'd:/cygwin/usr/local/jdk1.3.1'. This will make cygwin find jdk more easily.

Edit cygwin's '/etc/profile'. Add the following line:

chmod a+x /usr/local/jdk1.3.1/bin/*
Note: Doing this is for make to be able to determine they are executables.


MIDP is built on top of CLDC. Therefore, you need to download J2ME CLDC 1.0.4 first from Sun's website at

In cygwin, unzip
mv j2me_cldc cldc1.0.4fcs

Download J2ME MIDP 2.0, Windows version

In cygwin, unzip
chmod -R u+w midp2.0fcs

Modify build/win32/kvm/makefiles/Defs-pre.gmk, change 'gcc' to 'gcc-2'.
Note: This is because Cygwin's gcc (gcc 3.2) can't handle -mno-cygwin correctly. Therefore, we need to use gcc-2 (gcc 2.95.3) instead.

Modify build/win32/kvm/Platform.gmk:
KVM_DIR = $(BUILD_DIR)/../../../cldc1.0.4fcs

Build J2ME MIDP 2.0

cd midp2.0fcs/build/win32/kvm

make GCC=true ALT_BOOTDIR=/usr/local/jdk1.3.1

The built image is build/win32/kvm/bin/midp.exe