Compiling JDK 1.4.2 from source, under win32
Hi,
Here is how I compiled JDK 1.4.2 from source-code under win32. I hope this helps the many others who are interested in doing the same.
1) Download the sources from here: http://wwws.sun.com/software/communitysource/j2se/java2/download.html
Be sure to download *all* packages (SCSL source, SCSL binaries, mozilla binaries)
2) Download gnu make from here: http://ftp.gnu.org/pub/gnu/make/
3) Download Info-zip "zip" and "unzip" packages: http://www.info-zip.org/pub/infozip/UnZip.html and http://www.info-zip.org/pub/infozip/Zip.html
4) Request and evaluation copy of MKS Toolkit: http://www.mkssoftware.com/eval/
The key point here is that MKS Toolkit is a commercial product and even once you request an evaluation copy, it'll take a day or two for one of their salespeople to contact and harass you. Tell him whatever you must to get an evaluation copy out of him ("I might buy a copy in 3 months, honest!")... I personally wish Sun would move away from this commercial product and replace it with cygwin or something. It was very annoying getting past this stage.
5) Download the DirectX 9.0 SDK from here: http://www.microsoft.com/downloads/details.aspx?FamilyID=124552ff-8363-47fd-8f3b-36c226e04c85&displaylang=en
Sun actually requires DirectX 7.0 SDK but I couldn't find a copy anywhere so we have no choice but use a newer copy. This is another issue Sun should really address.
6) Install DirectX SDK, MKS Toolkit, Info-zip zip and unzip
7) Unpack gnu make into a directory and build it using the special steps for the MKS Toolkit shell. If you're trying to build make 3.80 be sure to fix this bug before you proceed or else it won't build: https://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=1687
8) Set your build environment variables. Here are my personal settings:
call "C:\Program Files\Microsoft Visual Studio\VC98\Bin\vcvars32.bat"
set ALT_UNIXCOMMAND_PATH=c:\mksnt
set ALT_MSVCRT_DLL_PATH=c:\windows\system32
set ALT_BOOTDIR=c:\j2sdk1.4.2_04
set ALT_DEVTOOLS_PATH=c:\j2sdk1.4.2_04\source\utils
set path=C:\make-3.80\WinRel;%path%
set include=%include%;c:\program files\microsoft sdk\include
set JAVA_HOME=
9) You *must* build against Visual C++ 6.0 (Visual C++ .NET won't work because its missing non-standard header files used by Sun, such as iostream.h)
10) "cd <jdk source dir>\control\make"
11) Edit <jdk source dir>\j2me\make\common\Sanity.gmk line 1135. Replace:
ifeq ($(PLATFORM), windows)
with
ifeq ($(PLATFORM), windows_skip)
This will cause the build process to ignore the fact that you have DirectX 9.0 when it requires version 7.0
12) Start the build process: "make scsl"
13) If the build process dies because you have a different service-pack of Visual C++ 6.0 than it expects, edit <jdk source dir>\j2me\make\common\Sanity.gmk lines 71-72 and modify the expected version numbers to the ones you have.
14) If you see a "'c:\program' not found" error while compiling. Be sure that the paths set by VCVARS32.BAT use short-names not long-names, because make gets confused by paths with spaces.
15) If you see an error "No rule to make target `/usr/src/j2sdk-1_4_2-src-scsl/control/build/linux-i586/lib/fonts/LucidaTypewriterRegular.ttf'" it means you forgot to extract the "SCSL binaries" package into the source-code directory
I will post solutions to further compiler errors as I encounter them, I encourage you to do the same.

