Skip to main content

JDK Build first impressions with Cygwin, Windows

32 replies [Last post]
blbrown
Offline
Joined: 2005-04-20

This is kind of a long post that goes over what I needed to change from the Sun documentation on the windows build. I know I should use the right versions, but I couldn't find the exact versions.

This worked for 'build32' with WindowsXP on April 22,2005

I compiled most of the JDK, I got any error when compiling Swing. So, I have a question about this at the end.

One major difference, I am using WindowsXP Service Pack 2, I didn't have W2K.

1. You will need Visual C++ 6, Microsoft didn't have Service Pack 3, so I download Service Pack6, which seemed to work(This is 2005)

I went ahead and edited the Sanity.gmk files to allow me to use this version of VC6.

'deploy/make/common/Sanity.gmk'
'j2se/make/common/Sanity.gmk'

And just changed the Script variablest to '12.00.8804'

2. I downloaded Cygwin version 1.5.15-1 which contains the right version of 3.80, make sure to install 'make', by default cygwin doesn't install a lot of the development tool.s

3. I downloaded DX9 - Microsoft DirectX 9.0 SDK (February 2005), seemed to work.

C:/Progra~1/Micros~2/ -- I used the DOS name like so.

4. This is a tricky one, the unicows.dll was pretty easy to find, follow the instructions. I couldn't find the 'unicows.lib' because it seems like Microsoft has hidden the Platform SDK for Windows98/95.

I did some googling and you can find the 300MB+ Platform SDK. It seems like MS has a hidden link for all the CAB files on their site. You are looking for the Win9x SDK.

This is the Oct2002 or the Nov2002 update?

http://download.microsoft.com/download/platformsdk/sdk/update/win98mexp/...

And for the sake of a shorter post. There are '16' cab files, replace the '1' above and download the rest, like so.
...PSDK-FULL.2.cab
...PSDK-FULL.3.cab

And two other files

...PSDK-FULL.bat
...extract.exe

You type 'PSDK-FULL.bat' in the directory where you downloaded the 'CAB' files and those will be extracted.

You 'can' type 'setup.exe' to install this Microsoft SDK. Unzipped, it weighs in at 300MB+, I didn't feel like installing this and messing up my system. I only needed the 'unicows.lib' file which is a 2MB file.

Enter the 'setup' directory of the Platform SDK

The cab files are just zipped files, so I looked through all of them and found 'CoreSDK-common.2.1.cab'. This contained the 'unicows.lib'. I unzipped it and it gave me some weird file name

unicows_lib.6DA6B05C_F046_4C67...

I renamed this to

unicows.lib and here is the Nov?(Oct) 2002 File. There you go. Put this somewhere and change your ALT_UNICOWS_LIB_PATH

Another note. It looks like JDK build script is looking for the file size of this particular file to validate it.

It just happens, my filesize matched: '2325412'

5. This is a small bug in "windows/cygwin"? or the build script. The unicows.lib sanity check may fail because of weird naming with cygwin and windowsxp. For example, the script is looking for a filesize
'-rwx------+ 1 Your Name None 2325412 unicows.lib

It is looking for the filesize at the '5th' spot of this string above using an NAWK script. If you look above because "Your Name", the filesize will end up at the '6th' spot which will generate an error in your build and won't allow you to continue. After some debugging, I grepped on (REQUIRED_UNICOWS_LIB_SIZE) and on line 1453 of Sanity.gmk, I changed the '$$5' to '$$6'. This is only because of my username having a 'space' in the text.(j2se/make/common/Sanity.gmk)

6. I couldn't find the 'msvcrt.dll version 6.00.8337.0' with my copy of Microsoft Visual 6. I googled and found a download somewhere. This seems pretty easy to find. I currently have a version 7.0 of the dll with WinXP.

7. Now, I passed the Sanity Checks, I got a build error that seemed to stem from my username again "My Name". It seems like the scripts don't like whitespace. So from the Window's environment variables. I manually changed:

set USERNAME=MyName

8. Also, I added the 'b' to the BUILD_NUMBER like so.

set ALT_BOOTDIR=C:\PROGRA~1\Java\jdk1.5.0
set MILESTONE=beta
set BUILD_NUMBER=b32

9. Typed 'make scsl'

10. Two more errors. It looks like the 'fonts' directory is empty and the build script is looking for it. I got an error, "Can't find target LucidaTypewriterRegular.ttf" something...

j2se\src\share\lib\fonts -- This directory was empty?

So, I installed the "binary" release and searched for the fonts and copy pasted them to that folder. There were 8 ttf fonts.

11. After those small changes, I got pretty far. I compiled 'javac.exe' and a lot of the other binaries. I did get an error with compiling Swing and I will stop for now.

So this is my question. I got pretty far in the build and then I got this error:

rm c:/Berlin/JDK/src/control/build/windows-i586/tmp/l10n/j2se/sun/print/resource
s/serviceui_zh_HK.properties
make[4]: Leaving directory `/cygdrive/c/Berlin/JDK/src/j2se/make/javax/print'
<<>>Recursively making swing all @ Sat Apr 23 03:19:56 EST 2005 ...
make[4]: Entering directory `/cygdrive/c/Berlin/JDK/src/j2se/make/javax/swing'
make[4]: *** No rule to make target `c:/Berlin/JDK/src/control/build/windows-i58
6/classes/javax/swing/plaf/basic/BasicButtonListener.class', needed by `c:/Berli

It looks like my 'BasicButtonListener.class'? Something wrong with this target?

Thank you, sorry for being so verbose. This seems to be a quiet forum. I will try not to make so much noise next time.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vijayj
Offline
Joined: 2004-10-26

I see two issues from the information provided above.

o Cygwin is ahead of VC++ in your PATH variable. If you add cygwin towards the end the PATH then all your problems will be resolved.

o You don't have C:/temp directory. I suggest you create this directory manually.

Thanks,
-Vijayan.

wasedaxiao
Offline
Joined: 2003-06-13

There is a file called "sanityCheckMessages.txt" in your output build dir that shows sanity check results to your env variables.
Especially be careful with "CC_VER" by which I was also annoyed. I tweaked some parts in the make files and built successfully.

radhamohan
Offline
Joined: 2004-11-16

> There is a file called "sanityCheckMessages.txt" in
> your output build dir that shows sanity check results
> to your env variables.
> Especially be careful with "CC_VER" by which I was
> also annoyed. I tweaked some parts in the make files
> and built successfully.

I am not sure how to fix CC_VER but I used BUILD_HOTSPOT=false.

This time I see
../../../../src/windows/resource/version.rc(9) : fatal error RC1015: cannot open
include file 'afxres.h'.

According to this URL http://www.winprog.org/tutorial/errors.html#RC1015

I replaced "afxres.h" with "winres.h" but the error is similar. It can't open this file.

Mohan

klausj
Offline
Joined: 2005-01-31

I'm using
make BUILD_INSTALL=false DEPLOY= scsl
and changed the command line in Release.gmk, but I still
get the ... bin/HtmlConverter.exe not found error.

vijayj
Offline
Joined: 2004-10-26

> make BUILD_INSTALL=false DEPLOY= scsl

From which build you have downloaded the source. Do you have the up-to-date source?.

Thanks,
-Vijayan.

klausj
Offline
Joined: 2005-01-31

I tried build 35. Is the problem fixed in the latest build ?

vijayj
Offline
Joined: 2004-10-26

> I tried build 35. Is the problem fixed in the latest build ?

Yes we have fixed this issue sometime back but I don't know the exact build number. If you try with our latest source build b43 then you won't see this problem.

Thanks,
-Vijayan.

klausj
Offline
Joined: 2005-01-31

I successfully build b43 now.

I had to set the INSANE option, because I use a german version of the VC++ Compiler.
During the build I recognized some errors:
c:/cygwin/bin/tar: argument list too long.

But the build is working.
Thanks.

vijayj
Offline
Joined: 2004-10-26

> I successfully build b43 now.

Congratulations...

> I had to set the INSANE option, because I use a german version of the VC++ Compiler.

Yes only English version is officially supported.

> During the build I recognized some errors: c:/cygwin/bin/tar: argument list too long.

Can you give some information about this error? Exactly which part of the build you are seeing this error? If you could post some output from the log file then it will be so great.

Also can you please post your general experience on building JDK?.

Thanks,
-Vijayan.

klausj
Offline
Joined: 2005-01-31

Here some notes of my build experience:

The build should support the latest versions/service packs of VC++ compiler, DirectX SDK, MS-SDK,... because it's hard to get the required versions. In this forum some links of servers somewhere in the internet are posted to get the right downloads, but I think it's not a good idea to install packages from unknwon servers.
Some packages have default install pathes containing blanks. I recognized that the build cannot handle blanks (I guess a problem with missing quotes) , so I installed the packages to non default pathes.
I had to change many of the ALT_ parameters for package locations.
No problem, but I wondered about the requirement to install ZIP utils, though a JRE with jar binary is available at build time.

Is a build log file automatically created and if so where can I find it ?

kellyohair
Offline
Joined: 2004-09-03

I agree on the latest versions, we are working on that. It's unacceptable that the required versions aren't available, from the proper sources. We will fix this soon.

On the default paths and the spaces in paths, we are also working on fixing that too, automatically in the makefiles we will translate the path to the non-space name. I've also been trying to minimize the number of ALT variables you need to set and if at all possible detect the install locations of the components via the component's environment variable (e.g. VC71COMNTOOLS, DXSDK_DIR, ROOTDIR, etc.).

I'll have to look into the zip vs. jar issue, hadn't thought about that one much. If Cygwin is being used, the zip and unzip available from cygwin are perfectly acceptable. I think historically we had run into some problematic versions of zip/unzip, but that is probably ancient history.

There is no automatic build log, you would need to:
gnumake dev > log 2>&1 (maybe tail -f log in another shell window?)
or something like
gnumake dev 2>&1 | tee log

-kto

radhamohan
Offline
Joined: 2004-11-16

Hi,
Can't I build with Visual Studio .NET 2003 ?

I get this error. My sanity check shows this as one of the errors.

ERROR: To build Java 2 SDK 1.6.0 you need :
Visual C++ 6.0 Professional + VC6-SP 3 - cl.exe version "12.00.8168"
You are using Compiler version ""
Please install the required version of Visual C++ and start your build ag
ain.

Mohan

kellyohair
Offline
Joined: 2004-09-03

You need to run the vcvars32.bat file to setup your PATH, INCLUDE, and LIB.

I've seen this error when the makefile can't run 'cl.exe' to get it's version number. You might try just running 'cl' in a shell and see if that prints out anything.

radhamohan
Offline
Joined: 2004-11-16

I added "/cygdrive/c/Program Files/Microsoft Visual Studio .NET 2003/Vc7/bin":"/cygdrive/c/Program Files/Microsoft Visual Studio .NET 2003/Common7/IDE"

these in my /etc/profile

and ran cl at the prompt.

I see

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

My sanity check still shows the same message.

Thanks,
Mohan

vijayj
Offline
Joined: 2004-10-26

Hi,

Can you please send your PATH value and ALT_COMPILER_PATH value?.

-Thanks,
Vijayan.

radhamohan
Offline
Joined: 2004-11-16

It seems that I have solved all other problems except these. I am using .NET 2003.

The original errors are still there.

--------------------------------------------------------

ERROR: To build Java 2 SDK 1.6.0 you need :
Visual C++ 6.0 Professional + VC6-SP 3 - cl.exe type "Optimizing"
You are using Compiler type "file"
Please install the required version of Visual C++ and start your build ag
ain.

ERROR: To build Java 2 SDK 1.6.0 you need :
Visual C++ 6.0 Professional + VC6-SP 3 - cl.exe version "12.00.8168"
You are using Compiler version ""
Please install the required version of Visual C++ and start your build ag
ain.

ERROR: To build Java 2 SDK 1.6.0 you need :
Visual C++ 6.0 Professional + VC6-SP 3 - link.exe version "6.00.8447"
You are using Linker version ""
Please install the required version of Visual C++ and start your build again.

--------------------------------------------------------

and these lines

C:/cygwin/Bin/link: missing operand
Try `C:/cygwin/Bin/link --help' for more information.
C:/cygwin/bin/df: `C:/TEMP': No such file or directory
C:/cygwin/Bin/link: missing operand
Try `C:/cygwin/Bin/link --help' for more information.
make[2]: Entering directory `/cygdrive/c/tools/mustang/source/deploy/make'
make[2]: Leaving directory `/cygdrive/c/tools/mustang/source/deploy/make'
C:/cygwin/Bin/link: missing operand
Try `C:/cygwin/Bin/link --help' for more information.
C:/cygwin/bin/df: `C:/TEMP': No such file or directory

My PATH is

--------------------------------------------------------

/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/cygdrive/c/Program Files/IBM/WebSphere MQ/Java/lib:/cygdrive/c/BLUEMA~1/HUMMIN~1/bin:/cygdrive/c/BLUEMA~1/HUMMIN~1/Appserver:.:.:/cygdrive/c/BlueMartini/bin:/cygdrive/c/orabpel/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/program files/winzip:/cygdrive/c/data/notes:/cygdrive/c/program files/notes:/cygdrive/c/Program Files/Microsoft SQL Server/80/Tools/BINN:/cygdrive/c/BLUEMA~1/HUMMIN~1/Appserver/jre_13/bin:/cygdrive/c/Program Files/IBM/WebSphere MQ/bin:/cygdrive/c/Program Files/IBM/WebSphere MQ/tools/c/samples/bin:.:/cygdrive/c/j2sdk1.4.2_07/bin:/cygdrive/c/apache-ant-1.6.2/bin:/cygdrive/c/Program Files/IBM/WebSphere MQ/Java/lib:/cygdrive/c/BLUEMA~1/HUMMIN~1/bin:/cygdrive/c/BLUEMA~1/HUMMIN~1/Appserver:.:.:/cygdrive/c/BlueMartini/bin:/cygdrive/c/orabpel/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/program files/winzip:/cygdrive/c/data/notes:/cygdrive/c/program files/notes:/cygdrive/c/Program Files/Microsoft SQL Server/80/Tools/BINN:/cygdrive/c/BLUEMA~1/HUMMIN~1/Appserver/jre_13/bin:/cygdrive/c/Program Files/IBM/WebSphere MQ/bin:/cygdrive/c/Program Files/IBM/WebSphere MQ/tools/c/samples/bin:.:.:/cygdrive/c/Program Files/Microsoft Visual Studio .NET 2003/Vc7/bin:/cygdrive/c/Program Files/Microsoft Visual Studio .NET 2003/Common7/IDE

--------------------------------------------------------

I am not using ALT_COMPILER_PATH.

Thanks,
Mohan

radhamohan
Offline
Joined: 2004-11-16

I used this command and it passes the sanity check. I see the message "Sanity Check passed"

make scsl ALT_BOOTDIR=/cygdrive/c/Progra~1/Java/jdk1.5.0 ALT_UNICOWS_DLL_PATH=/cygdrive/c ALT_UNICOWS_LIB_PATH=/cygdrive/c/tools/mustang ALT_DXSDK_PATH=/cygdrive/c/Progra~1/Microsoft_DirectX ALT_MSVCRT_DLL_PATH=/cygdrive/c/windows/system32 ALT_DXSDK_INCLUDE_PATH="/cygdrive/c/Progra~1/Microsoft_DirectX/Include" ALT_COMPILER_PATH=/cygdrive/c/Progra~1/MICROS~2.NET/Vc7/bin ALT_MSVCR71_DLL_PATH=/cygdrive/c/WINDOWS/system32 ALT_MSVCP71_DLL_PATH=/cygdrive/c/tools/jdk1.6.0/bin

The errors that are left are

C:/cygwin/bin/df: `C:/TEMP': No such file or directory

AND

main.cpp
c:\tools\mustang\source\hotspot\src\share\vm\adlc\adlc.hp
p(14) : fatal error C10
83: Cannot open include file: 'stdio.h': No such file or directory

This second error repeats a few times and each time it is a different .cpp file.

At the end I see

NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio .NET 2003\
Vc7\bin\nmake.exe"' : return code '0x2'
Stop.

Thanks,
Mohan

vijayj
Offline
Joined: 2004-10-26

> main.cpp
> c:\tools\mustang\source\hotspot\src\share\vm\adlc\adlc.hp
> p(14) : fatal error C10
> 83: Cannot open include file: 'stdio.h': No such file or directory

As I said in my previous posting, you have CYGWIN ahead of VC++ values in your PATH. If you add cygwin towards the end of the PATH then it should resolve your problem.

Thanks,
-Vijayan.

radhamohan
Offline
Joined: 2004-11-16

I changed the PATH but the errors are the same. I also checked the variables set by vcvars32.bat.

Thanks
Mohan

vijayj
Offline
Joined: 2004-10-26

I am pretty sure that your ENV is messed up. If you could email your OUTPUTDIR/build/windows-i586/sanityCheckMessage.txt and
OUTPUTDIR/build/windows-i586/sanityCheckError.txt to vijayj@dev.java.net then I will see what I can do for you.

Thanks,
-Vijayan.

radhamohan
Offline
Joined: 2004-11-16

I have managed to build it. I didn't have to change anything in the make file.

Since I didn't know how to run vcvars32.bat from the Cygwin prompt I included everything in this batch file in \etc\profile. This didn't work for a long time because there seemed to be problems even after I changed normal path names to mangled path names.

So I used make from a DOS prompt (http://www.mindview.net/Etc/GnuMake) after running vcvars32.bat. My build stopped after running for some time because it couldn't find jni.h and jni_md.h and I just added this path C:\tools\mustangAug11\control\build\windows-i586\include to %INCLUDE% already set by vcvars32.bat

I spent a few days trying to solve the path problems but it is built now.

vijayj
Offline
Joined: 2004-10-26

You cannot run batch files from cygwin shell (at least I don’t know how to do that either). If you prefer to use cygwin then you need to set INCLUDE and LIB variable in your build environment.

I am glad to know that you are able to build successfully now.

Thanks for posting your final outcome.

-Vijayan.

alexanderschunk
Offline
Joined: 2005-03-24

Wow,

never thought to do much hacking like this on a windows machine to get a compile running?

I got the same settings: WindowsXP Pro and Cygwin except that i use Visual Studio 2003 .NET.

I assume that i don't need the Microsoft SDK in this case because the .NET Studio uses the .NET Redistributable package.

However, i managed to start a compile with make only in the command line but did not go far anyway.

I assume that i don't need the unicow.lib file also.

kellyohair
Offline
Joined: 2004-09-03

You've got the same setup I've got too.

You do need the UNICOWS.LIB and UNICOWS.DLL eventually, the LIB file (or one you can use) is also inside the Visual Studio .Net 2003 install area. The DLL you need to download from the microsoft site. There is a current problem with the Sanity check right now on UNICOWS.LIB, it wants you to have an very old version that isn't easily available, the newer one is fine. So you may need to go into the file j2se/make/common/Sanity.gmk and delete the UNICOWS.LIB checking on it's size. We will fix this in B45.

Assuming you have B42+, a 'cd control/make; gnumake dev-sanity' should just do the sanity checks, once you get past that 'cd control/make; gnumake dev' should work.

Good Luck. If you have ideas on how to make it easier or less painful, please post them. Thanks.

blbrown
Offline
Joined: 2005-04-20

I think I fixed the error from above. And, I am actually trying to be able to type 'make scsl' on the fresh jdk and then continue to the end without error. So far, it looks most of the build issues for Cygwin/Windows are missing files related? For example, some of the 'swing' resource files(*.gif/*.png) files were missing? I actually found some in the binary release and some on the internet.

For example these images were missing from the source:

** Missing images Files from the swing/plaf directories **

./j2se\src\share\classes\com\sun\java\swing\plaf\windows\icons

Normally, the build error is something dealing with a missing TARGET:

c:/Berlin/JDK/src/control/build/windows-i586/classes/com/sun/java/swing/plaf/windows/icons/Computer.gif
make[5]: *** No rule to make target `c:/Berlin/JDK/src/control/build/windows-i586/classes/com/sun/java/swing/plaf/windows/icons/DetailsView.gif',needed by `oth

I could basically scan this file, FILES.gmk and check if the file existed in the right directory. Some were, some weren't

j2se/make/javax/swing/plaf/FILES.gmk:

I also copied the "audio/soundbank.gm" from the binary package into the source package to "j2se/make/javax/sound"

And, if you don't already know "grep -ri SEARCH_TERM *" works real well for these type errors.

My Question

It looks like with the changes above you can get pretty far into the build. I got passed with the demos, javawebstart. I am at the plugins, here is an error that looks like it has to do with the HTMLCONVERTER.

In a file "Release.gmk"(deploy/make/common/Release.gmk)

The variable gets set
ABS_HTMLCONVERTER := $(shell $(CYGPATH) -w -a $(BINDIR)/HtmlConverter$(EXE_SUFFIX))

And then later on gets used:

$(ABS_HTMLCONVERTER) -source ...

This didn't work..

It looks like the windows style '\' separators are left in there, such that you get this.

BerlinJDKsrccontrolbuildwindows-i586binHtmlConverter.exe

So I converted to below

$(BINDIR)/HtmlConverter$(EXE_SUFFIX) -source $(DEMODIR)/plugin/$${demos} -subdirs \

This should have worked, when I searched for the file HtmlConverter.exe, it looks like it never got compiled?

Here is the error message from the build:

for demos in applets jfc; do \
C:/cygwin/bin/cp.exe -r c:/Berlin/JDK/src/control/build/windows-i586/demo/${
demos} c:/Berlin/JDK/src/control/build/windows-i586/demo/plugin; \
C:/cygwin/bin/chmod.exe -R +w c:/Berlin/JDK/src/control/build/windows-i586/d
emo/plugin/${demos}; \
c:\Berlin\JDK\src\control\build\windows-i586\bin\HtmlConverter.exe -source c
:/Berlin/JDK/src/control/build/windows-i586/demo/plugin/${demos} -subdirs \
|| exit 1; \
done

C:BerlinJDKsrccontrolbuildwindows-i586binHtmlConverter.exe: not found

make[3]: *** [deploy-jdk-image] Error 1
make[3]: Leaving directory `/cygdrive/c/Berlin/JDK/src/deploy/make/plugin'
make[2]: *** [images] Error 2
make[2]: Leaving directory `/cygdrive/c/Berlin/JDK/src/deploy/make'
make[1]: *** [deploy-build] Error 2
make[1]: Leaving directory `/cygdrive/c/Berlin/JDK/src/control/make'
make: *** [scsl-build] Error 2

kellyohair
Offline
Joined: 2004-09-03

You have gotten a long way...

Most JDK developers don't need to go beyond building the j2se workspace, so few venture into the deploy or install workspaces. This most certainly is a cygwin issue of some kind.

I suspect we still have some cygwin issues with the deploy and install workspaces we need to work out, most of our focus on the cygwin work was in the j2se workspace.

We also haven't been able to completely transition as many internal people to using cygwin as we would like (many still use MKS). We need to fix that.

If you use:

make BUILD_INSTALL=false DEPLOY= scsl

You should be able to skip the building of the deploy (plugin) and install workspace. Normally you would never need to build the install workspace anyway, all it does is create the formal installation bundles. But some people might want the deploy workspace built to have the plugins, so we'll look at the deploy cygwin issues first.

Thanks for posting this, it will be a big help!

blbrown
Offline
Joined: 2005-04-20

*windows i586 1.6.0-beta build started: 05-04-26 ((18:17))
generic_debug_build build finished: 05-04-26 ((19:59))
make[2]: Leaving directory `/cygdrive/c/Berlin/JDK/src/control/make'
fastdebug_build build finished: 05-04-26 19:59
Control workspace build finished: 05-04-26 19:59
make[1]: Leaving directory `/cygdrive/c/Berlin/JDK/src/control/make'

And for those who want to find out how long it takes to build. It looks like about 2 hours.

My machine is a 2GHZ - 512MB machine.

kellyohair
Offline
Joined: 2004-09-03

So was this with:

gnumake BUILD_INSTALL=false DEPLOY= ?

And did we solve the problem that appeared like missing files?

Starting with Build 34 or 35, if you download the built JDK along with the source bundles, you could:

gnumake BUILD_INSTALL=false DEPLOY= BUILD_HOTSPOT=false ALT_JDK_IMPORT_PATH=/jdk_home_of_build33_image

This prevents the compilation of the HotSpot VM and will copy the pre-built jvm.dll into your build from the import area and save some you some time.

Besides all the bugs and rfes in the previous replies, I'm looking at expanding this importing of dll's from a previous build, which might avoid even more native compilations. Of course that would only be safe for people only changing Java code and not changing any of the 'native' methods in any way. I'll also try and create some make rule short cuts and make this a bit cleaner from a usability point of view.

Congrads on doing a successful build! And thanks for doing the post, it is really appreciated.

blbrown
Offline
Joined: 2005-04-20

I did the 'make scsl' and it looks like it went through the whole thing. I will use the faster build in the future though. Thanks for the help.

In terms of help for the targets in the Makefile. Yea, I should have looked at the entry Makefile to begin with. including the 'make j2se_only'.

kellyohair
Offline
Joined: 2004-09-03

I trimmed this down to what I think are the issues we need to deal with. I also apologize for the long winded answers :^)

> ...
> One major difference, I am using WindowsXP Service
> Pack 2, I didn't have W2K.

This 'should' be ok. It's not an official build, but that doesn't matter. And if there are issues with building on XPsp2 we need to know.

>
> 1. You will need Visual C++ 6, Microsoft didn't have
> Service Pack 3, so I download Service Pack6, which
> seemed to work(This is 2005)

This should be fine, Build33 will have the bulk of the changes to allow for VC++7 or VC++6 to build the j2se, but we have a few issues with building the plugin that need to be resolved before we can do the official switch to VC++7 (.NET 2003). In the meantime, VC++6.2 is a minimum requirement, and is still the default for our release engineering team. We will try and allow for either compiler to build it for a while, even after defaulting to VC7++.

>
> I went ahead and edited the Sanity.gmk files to allow
> me to use this version of VC6.
>
> 'deploy/make/common/Sanity.gmk'
> 'j2se/make/common/Sanity.gmk'
>
> And just changed the Script variablest to
> '12.00.8804'

We have an rfe 6206054 which should address this, I bumped up the priority on it so it will get done sooner.
You shouldn't have to edit the Sanity files, using different releases of the compilers should just be a warning.

>
> 2. I downloaded Cygwin version 1.5.15-1 which
> contains the right version of 3.80, make sure to
> install 'make', by default cygwin doesn't install a
> lot of the development tool.s

I filed an RFE 6260866, to make sure this information is
documented. Thanks for noting the 'make' issue.

>
> 3. I downloaded DX9 - Microsoft DirectX 9.0 SDK
> (February 2005), seemed to work.
>
> C:/Progra~1/Micros~2/ -- I used the DOS name like
> so.
>

I added a comment on RFE 6210745. Thanks for noting this.

> 4. This is a tricky one, the unicows.dll was pretty
> easy to find, follow the instructions. I couldn't
> find the 'unicows.lib' because it seems like
> Microsoft has hidden the Platform SDK for
> Windows98/95.
>
> I did some googling and you can find the 300MB+
> Platform SDK. It seems like MS has a hidden link for
> all the CAB files on their site. You are looking for
> the Win9x SDK.
>
> This is the Oct2002 or the Nov2002 update?
>
> http://download.microsoft.com/download/platformsdk/sdk
> /update/win98mexp/en-us/3718.1/FULL/PSDK-FULL.1.cab
>
> And for the sake of a shorter post. There are '16'
> cab files, replace the '1' above and download the
> rest, like so.
> ...PSDK-FULL.2.cab
> ...PSDK-FULL.3.cab
>
> And two other files
>
> ...PSDK-FULL.bat
> ...extract.exe
>
> You type 'PSDK-FULL.bat' in the directory where you
> downloaded the 'CAB' files and those will be
> extracted.
>
> You 'can' type 'setup.exe' to install this Microsoft
> SDK. Unzipped, it weighs in at 300MB+, I didn't
> feel like installing this and messing up my system.
> I only needed the 'unicows.lib' file which is a 2MB
> B file.
>
> Enter the 'setup' directory of the Platform SDK
>
> The cab files are just zipped files, so I looked
> through all of them and found
> 'CoreSDK-common.2.1.cab'. This contained the
> 'unicows.lib'. I unzipped it and it gave me some
> weird file name
>
> unicows_lib.6DA6B05C_F046_4C67...
>
> I renamed this to
>
> unicows.lib and here is the Nov?(Oct) 2002 File.
> There you go. Put this somewhere and change your
> r ALT_UNICOWS_LIB_PATH
>
> Another note. It looks like JDK build script is
> looking for the file size of this particular file to
> validate it.
>
> It just happens, my filesize matched: '2325412'
>

I'm going to create a new bug on this 6260871.
We'll try and make this easier to setup.

> 5. This is a small bug in "windows/cygwin"? or the
> build script. The unicows.lib sanity check may fail
> because of weird naming with cygwin and windowsxp.
> For example, the script is looking for a filesize
> '-rwx------+ 1 Your Name None 2325412
> unicows.lib
>
> It is looking for the filesize at the '5th' spot of
> this string above using an NAWK script. If you look
> above because "Your Name", the filesize will end up
> at the '6th' spot which will generate an error in
> your build and won't allow you to continue. After
> some debugging, I grepped on
> (REQUIRED_UNICOWS_LIB_SIZE) and on line 1453 of
> Sanity.gmk, I changed the '$$5' to '$$6'. This is
> only because of my username having a 'space' in the
> text.(j2se/make/common/Sanity.gmk)
>

I filed a separate bug on this one 6260873.

> 6. I couldn't find the 'msvcrt.dll version
> 6.00.8337.0' with my copy of Microsoft Visual 6. I
> googled and found a download somewhere. This seems
> pretty easy to find. I currently have a version 7.0
> of the dll with WinXP.

Turns out that the binary JDK 6.0 download (built install images) will have this msvcrt.dll, or should.
I'm going to file a bug to try and fix this so that by default it looks in the same place it's getting the built VM. Hopefully I can just make this requirement be invisible. I filed bug 6260876.

Also, I think this is just a minimal version, and although some more paranoid people may think we need to have this exact version, I suspect you have a newer version in your system that would work just fine.

As I understand it, every product ships it's own version of msvcrt.dll simply because they can't guarantee that the one found by the default Windows search wouldn't come from some ancient product that happened to be in your PATH search settings. I suspect the basic requirement should be some version or newer, but we of course can't guarantee that every newer version doesn't have or uncover some kind of bug somewhere, I suspect that would be very very rare.

>
> 7. Now, I passed the Sanity Checks, I got a build
> error that seemed to stem from my username again "My
> Name". It seems like the scripts don't like
> whitespace. So from the Window's environment
> variables. I manually changed:
>
> set USERNAME=MyName

We should have a sanity check for that or better yet, we should figure out how to deal with this automatically. I've filed an RFE for that too 6260885.

>
> 8. Also, I added the 'b' to the BUILD_NUMBER like
> so.
>
> set ALT_BOOTDIR=C:\PROGRA~1\Java\jdk1.5.0
> set MILESTONE=beta
> set BUILD_NUMBER=b32

This was fixed bug 6256309. The default BUILD_NUMBER didn't have a 'b[0-9]' pattern in it.

>
> 9. Typed 'make scsl'
>
> 10. Two more errors. It looks like the 'fonts'
> directory is empty and the build script is looking
> for it. I got an error, "Can't find target
> LucidaTypewriterRegular.ttf" something...
>
> j2se\src\share\lib\fonts -- This directory was
> empty?
>
> So, I installed the "binary" release and searched for
> the fonts and copy pasted them to that folder. There
> were 8 ttf fonts.
>

I filed 6260889 on this issue, maybe we can make this more obvious, or add a sanity check or something.

>
> 11. After those small changes, I got pretty far. I
> compiled 'javac.exe' and a lot of the other binaries.
> I did get an error with compiling Swing and I will
> l stop for now.
>
> So this is my question. I got pretty far in the
> build and then I got this error:
>
> rm
> c:/Berlin/JDK/src/control/build/windows-i586/tmp/l10n/
> j2se/sun/print/resource
> s/serviceui_zh_HK.properties
> make[4]: Leaving directory
> `/cygdrive/c/Berlin/JDK/src/j2se/make/javax/print'
> << > 03:19:56 EST 2005.
> >>>Recursively making swing all @ Sat Apr 23 03:19:56
> EST 2005 ...
> make[4]: Entering directory
> `/cygdrive/c/Berlin/JDK/src/j2se/make/javax/swing'
> make[4]: *** No rule to make target
> `c:/Berlin/JDK/src/control/build/windows-i58
> 6/classes/javax/swing/plaf/basic/BasicButtonListener.c
> lass', needed by `c:/Berli
>
>
> It looks like my 'BasicButtonListener.class'?
> Something wrong with this target?
>

Ok, now you have me stumped. I'll ask the swing team if they have ever seen this build failure before but I suspect it's not a swing issue as much as a generic windows build issue. It looks a little like the failures I've seen in the past where the command line has exceeded the windows limit, but I changed the javac compiles to use the '@' option to avoid this problem.

You might make sure that the java source file:
j2se/src/share/classes/javax/swing/plaf/basic/BasicButtonListener.java
exists in your source area.

I'll file a bug on this so we don't forget about it 6260905. Since you are using XP, VC++6.2sp6, and cygwin, it's possible it's one of these or a combination of them could be causing this problem.
I'm suspecting cygwin, but I don't have any proof.

In the meantime, could you try doing a 'make clean' and seeing if this failure is repeatable? I'd appreciate it, might take us a bit of time to find a matching machine setup around here.

>
> Thank you, sorry for being so verbose. This seems to
> be a quiet forum. I will try not to make so much
> noise next time.

Please continue to make noise, especially this valuable noise. It is appreciated.

We owe you a t-shirt!

-kto

vijayj
Offline
Joined: 2004-10-26

>>
>> 2. I downloaded Cygwin version 1.5.15-1 which
>> contains the right version of 3.80, make sure to
>> install 'make', by default cygwin doesn't install a
>> lot of the development tool.s

>I filed an RFE 6260866, to make sure this information is
> documented. Thanks for noting the 'make' issue.

By default cygwin instillation doesn't install all the tools required to build our jdk product.

We need the following tools along with the default installation.

Binary : Package : Details
--------------------------------
ar.exe : Devel : (binutils: The GNU assembler, linker and binary utilities)
cpio.exe : Utils : (cpio: A program to manage archives of files)
file.exe : Utils : (file: Determines file type using 'magic' numbers)
m4.exe : Interpreters : (m4: GNU implementation of the traditional Unix macro processor)
make.exe : Devel : (make: The GNU version of the 'make' utility)

This information will be updated in our build doc for build b36.

Thanks,
-VJ.

kellyohair
Offline
Joined: 2004-09-03

I'm planning on creating some bugs/rfes against the JDK to address some of these issues. Then I'll do a better reply.

But I do want to express my thanks for you posting this, without people taking the time to tell us (sometimes over and over) what is wrong, we can't fix it. Sometimes we know about the problem, and sometimes we don't, but I'll do my best to make sure we at least have a record of the problems.

So thanks! Give me a day or two for a detailed response.