Skip to main content

Building Mustang JDK with MSVC 2005 Express?

24 replies [Last post]
benjismith
Offline
Joined: 2006-05-13
Points: 0

I've read Kelly O'Hair's blog entry about building the JDK on Windows 2000, with Visual Studio .NET 2003 Professional. My environment is slightly different. I'm on WinXP, with Visual Studio .NET 2005 Express, and I'm wondering whether anyone has had success building the JDK in this environment?

I only need to target my own machine for deployment, so I won't need to build Win98 or linux or solaris JDKs.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
m_r_atkinson
Offline
Joined: 2003-08-29
Points: 0

Yes, that is it.

m_r_atkinson
Offline
Joined: 2003-08-29
Points: 0

I've slightly changed my *.bat files, setup.bat is:

set path=C:\tools;C:\cygwin\bin;C:\jdk_b84\jdk1.5.0_06\bin;C\windows;c:\windows\system32;
call C:\jdk_build_tools\vsvars32.bat
set JAVA_HOME=
set ALT_BOOTDIR=C:\\jdk_build_tools\\jdk1.5.0_06
set ALT_OUTPUTDIR=C:\jdk_b84_output
set ALT_UNIXCOMMAND_PATH=C:\cygwin\bin
set ALT_COMPILER_PATH=C:\jdk_build_tools\vs8\VC\bin
set ALT_MSDEVTOOLS_PATH=C:\jdk_build_tools\vs8\VC\bin
set ALT_DEPLOY_MSSDK=C:\jdk_build_tools\platform_sdk_2003
set ALT_DXSDK_PATH=C:\jdk_build_tools\DXSDK
set ALT_DEVTOOLS_PATH=C:\tools
set ALT_CACERTS_FILE=C:\jdk_build_tools\cacerts
set ALT_MSVCRT_DLL_PATH=C:\Windows\System32
set ALT_MSVCR71_DLL_PATH=C:\Windows\System32
set ALT_MSVCP71_DLL_PATH=C:\Windows\System32
set ALT_UNICOWS_DLL_PATH=C:\jdk_build_tools\unicows
set ALT_UNICOWS_LIB_PATH=C:\jdk_build_tools\unicows

set MILESTONE=beta
set BUILD_NUMBER=b84
set SECURITY_BASELINE_142=1.4.2_10
set SECURITY_BASELINE_150=1.5.0_06

and vsvars32.bat is:

@SET VSINSTALLDIR=C:\jdk_build_tools\vs8
@SET VCINSTALLDIR=C:\jdk_build_tools\vs8\VC
@SET FrameworkDir=C:\WINDOWS\Microsoft.NET\Framework
@SET FrameworkVersion=v2.0.50727
@SET FrameworkSDKDir=C:\jdk_build_tools\vs8\SDK\v2.0
@set DevEnvDir=C:\jdk_build_tools\vs8\Common7\IDE
@set PATH=C:\jdk_build_tools\vs8\Common7\IDE;C:\jdk_build_tools\vs8\VC\BIN;C:\jdk_build_tools\vs8\Common7\Tools;C:\jdk_build_tools\vs8\SDK\v2.0\bin;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\jdk_build_tools\vs8\VC\VCPackages;%PATH%
@set INCLUDE=C:\jdk_build_tools\vs8\VC\INCLUDE;C:\jdk_build_tools\DXSDK\Include;C:\jdk_build_tools\platform_sdk_2003\;C:\jdk_build_tools\platform_sdk_2003\Include;C:\jdk_build_tools\platform_sdk_2003\Include\mfc;C:\jdk_build_tools\platform_sdk_2003\Include\atl;C:\jdk_build_tools\platform_sdk_2003\Include\crt;C:\jdk_build_tools\platform_sdk_2003\Include\gl
@set LIB=C:\jdk_build_tools\DXSDK\Lib\x86;C:\jdk_build_tools\platform_sdk_2003\Lib;C:\jdk_build_tools\vs8\VC\LIB;C:\jdk_build_tools\vs8\SDK\v2.0\lib;
@set LIBPATH=C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

Now the JDK builds, but depolyment does not, I have made the following changes:

deploy/src/common/windows/native/auth.cpp(134)
change
env->SetCharArrayRegion(jServerAuth, nLen, 1, L":");

to
env->SetCharArrayRegion(jServerAuth, nLen, 1, (const jchar *)L":");

deploy/src/common/windows/native/auth.cpp(148)
change
env->SetCharArrayRegion(jProxyAuth, nLen, 1, L":");
to
env->SetCharArrayRegion(jProxyAuth, nLen, 1, (const jchar *)L":");

deploy/src/common/windows/native/config.cpp(233)
change
WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)uString, -1, mbcs, MAX_PATH, NULL, NULL);

to
WideCharToMultiByte(CP_ACP, 0, uString, -1, mbcs, MAX_PATH, NULL, NULL);

deploy/src/common/windows/native/config.cpp(324)
change
if (!SUCCEEDED(persistFile->Save(shortcutPath, TRUE))) {

to
if (!SUCCEEDED(persistFile->Save( (LPCOLESTR)shortcutPath, TRUE))) {

deploy/src/common/windows/native/config.cpp(569)
change

for (DWORD i = 0; i < ptg->GroupCount; ++i ) {

to
DWORD i;
for ( i = 0; i < ptg->GroupCount; ++i ) {

deploy/src/common/windows/native/proxy.cpp(57)
change
lpwszScript = env->GetStringChars(jScript, JNI_FALSE);

if (SUCCEEDED(jscriptEngine.Eval(lpwszScript, wszResult)))
result = env->NewString(wszResult, lstrlenW(wszResult));
}
__finally
{
if (lpwszScript != NULL)
env->ReleaseStringChars(jScript, lpwszScript);

to
lpwszScript = (wchar_t *)env->GetStringChars(jScript, JNI_FALSE);

if (SUCCEEDED(jscriptEngine.Eval(lpwszScript, wszResult)))
result = env->NewString((const jchar *)wszResult, lstrlenW(wszResult));
}
__finally
{
if (lpwszScript != NULL)
env->ReleaseStringChars(jScript, (const jchar *)lpwszScript);

but now I'm stuck with the following error:

C:/JDK_BU~1/vs8/VC/bin/cl -IC:/jdk_b84_output/tmp/deploy/deployObj
\
-I../../src/common/share/native \
-I../../src/common/windows/native \
-IC:/jdk_b84_output/tmp/deploy/deployClassHeaders \
-IC:\jdk_b84_output\j2sdk-image/include \
-IC:\jdk_b84_output\j2sdk-image/include/win32 \
-DWIN32 \
-DPERFLIB_EXPORTS \
-c -MD /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _STATIC
_CPPLIB /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE -O2 -FoC:/jdk_b
84_output/tmp/deploy/deployObj/WinRegistryWrapper.o ../../src/common/windows/nat
ive/WinRegistryWrapper.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

WinRegistryWrapper.cpp
C:\jdk_build_tools\platform_sdk_2003\Include\mfc\afxwin1.inl(1034) : error C4430
: missing type specifier - int assumed. Note: C++ does not support default-int
C:\jdk_build_tools\platform_sdk_2003\Include\mfc\afxwin1.inl(1036) : error C4430
: missing type specifier - int assumed. Note: C++ does not support default-int
make[4]: *** [C:/jdk_b84_output/tmp/deploy/deployObj/WinRegistryWrapper.o] Error 2

I've been trying the JDK and some of the demos seem to work OK, as does NetBeans.

m_r_atkinson
Offline
Joined: 2003-08-29
Points: 0

Ah, silly me I did not download and install the "JDK Binaries for Source Build 6", now I'm getting much further. I'm now failing on:

../../../../src/windows/native/com/sun/media/sound/engine/PLATFORM_API_WinOS_DirectSound.cpp
PLATFORM_API_WinOS_DirectSound.cpp
../../../../src/windows/native/com/sun/media/sound/engine/PLATFORM_API_WinOS_DirectSound.cpp(37) : fatal error C1083: Cannot open include file: 'dsound.h': No such file or directory

That is because the DXSDK includes were not in the include path.

Fixed by setting
@set INCLUDE=C:\jdk_build_tools\DXSDK\Include;C:\jdk_build_tools\vs8\VC\INCLUDE;C:\jdk_build_tools\platform_sdk_2003\Include;C:\jdk_build_tools\platform_sdk_2003\Include\mfc;%INCLUDE%
@set LIB=C:\jdk_build_tools\DXSDK\Lib\x86;C:\jdk_build_tools\platform_sdk_2003\Lib;C:\jdk_build_tools\vs8\VC\LIB;C:\jdk_build_tools\vs8\SDK\v2.0\lib;%LIB%

in vsvars32.bat (see prev post).

Message was edited by: m_r_atkinson

m_r_atkinson
Offline
Joined: 2003-08-29
Points: 0

My next problem is:

>>>Recursively making rmi all @ Wed May 24 19:21:42 GMTST 2006 ...
make[4]: Entering directory `/cygdrive/c/jdk_b84/j2se/make/sun/rmi'
Begin Processing OTHERSUBDIRS: corbalogsources corbalogcompile
>>>Recursively making corbalogsources all @ Wed May 24 19:21:44 GMTST 2006 ...
make[5]: Entering directory `/cygdrive/c/jdk_b84/j2se/make/sun/rmi/corbalogsources'
C:/cygwin/bin/mkdir -p C:/JDK_B8~1/gensrc/com/sun/corba/se/impl/logging C:/JDK_B8~1/bin/java -client -Xmx256m -Xms128m jscheme.REPL ../../../../src/share/classes/com/sun/tools/corba/se/logutil/scripts/mc.scm -main main make-class .
./../../../src/share/classes/com/sun/corba/se/spi/logging/data/Activation.mc C:/JDK_B8~1/gensrc/com/sun/corba/se/impl/logging
Exception in thread "main" java.lang.NoClassDefFoundError:jscheme/REPL
make[5]: *** [C:/JDK_B8~1/gensrc/com/sun/corba/se/impl/logging/ActivationSystemE
xception.java] Error 1
make[5]: Leaving directory `/cygdrive/c/jdk_b84/j2se/make/sun/rmi/corbalogsources'
make[4]: *** [all] Error 1

This seems to be cured by performing "make all" in the C:\jdk_b84\j2se\make\sun\rmi> directory.

Message was edited by: m_r_atkinson

m_r_atkinson
Offline
Joined: 2003-08-29
Points: 0

Now almost done, it got as far as cleaning up after building the JRE and then failed removing a directory:

rm: cannot remove directory 'C:\jdk_b8~1\j2sdk-image\src\java\math': Device or resource busy.

Fixed by closing various directories and apps, then rebuilding.

now get the error:

C:/cygwin/bin/touch C:/JDK_B8~1/tmp/deploy/deployObj/.class.headers.i586
make[6]: *** No rule to make target `/include/BaseTsd.h', needed by `C:/JDK_B8~1/tmp/deploy/deployObj/BaseTsd.h'. Stop.
rm C:/JDK_B8~1/tmp/deploy/l10n/com/sun/deploy/resources/Deployment_zh_HK.java

I need to
@set INCLUDE=C:\jdk_build_tools\platform_sdk_2003;C:\jdk_build_tools\DXSDK\Include;C:\jdk_build_tools\vs8\VC\INCLUDE;C:\jdk_build_tools\platform_sdk_2003\Include;C:\jdk_build_tools\platform_sdk_2003\Include\mfc;%INCLUDE%
in the vsvars32.bat file.

Message was edited (twice) by: m_r_atkinson

Message was edited by: m_r_atkinson

trembovetski
Offline
Joined: 2003-12-31
Points: 0

According to my build log the BaseTsd.h is copied from the MSSDK directory (this is with MKS Toolkit, though):
[code]
#>grep -i basetsd.h /java/re/jdk/1.6.0/nightly/logs/build-windows-i586.log
C:/mksnt/mksnt/cp C:/PROGRA~1/MICROS~1.NET/Vc7/PlatformSDK/include/BaseTsd.h C:/BUILD_AREA/jdk6/control/build/windows-i586/tmp/deploy/deployObj/BaseTsd.h
Processing C:\PROGRA~1\MICROS~1.NET\VC7\PlatformSDK\include\basetsd.h
basetsd.h
64 bit Processing C:\PROGRA~1\MICROS~1.NET\VC7\PlatformSDK\include\basetsd.h
basetsd.h
Processing C:\PROGRA~1\MICROS~1.NET\VC7\PlatformSDK\include\basetsd.h
basetsd.h
64 bit Processing C:\PROGRA~1\MICROS~1.NET\VC7\PlatformSDK\include\basetsd.h
basetsd.h
Processing C:\PROGRA~1\MICROS~1.NET\VC7\PlatformSDK\include\basetsd.h
basetsd.h
64 bit Processing C:\PROGRA~1\MICROS~1.NET\VC7\PlatformSDK\include\basetsd.h
basetsd.h
Processing C:\PROGRA~1\MICROS~1.NET\VC7\PlatformSDK\include\basetsd.h
basetsd.h
64 bit Processing C:\PROGRA~1\MICROS~1.NET\VC7\PlatformSDK\include\basetsd.h
basetsd.h
C:/mksnt/mksnt/cp C:/PROGRA~1/MICROS~1.NET/Vc7/PlatformSDK/include/BaseTsd.h C:/BUILD_AREA/jdk6/control/build/windows-i586-fastdebug/tmp/deploy/deployObj/BaseTsd.h
Processing C:\PROGRA~1\MICROS~1.NET\VC7\PlatformSDK\include\basetsd.h
basetsd.h
64 bit Processing C:\PROGRA~1\MICROS~1.NET\VC7\PlatformSDK\include\basetsd.h
basetsd.h
Processing C:\PROGRA~1\MICROS~1.NET\VC7\PlatformSDK\include\basetsd.h
basetsd.h
64 bit Processing C:\PROGRA~1\MICROS~1.NET\VC7\PlatformSDK\include\basetsd.h
basetsd.h
Processing C:\PROGRA~1\MICROS~1.NET\VC7\PlatformSDK\include\basetsd.h
basetsd.h
64 bit Processing C:\PROGRA~1\MICROS~1.NET\VC7\PlatformSDK\include\basetsd.h
basetsd.h
Processing C:\PROGRA~1\MICROS~1.NET\VC7\PlatformSDK\include\basetsd.h
basetsd.h
64 bit Processing C:\PROGRA~1\MICROS~1.NET\VC7\PlatformSDK\include\basetsd.h
basetsd.h
[/code]

Thanks,
Dmitri

m_r_atkinson
Offline
Joined: 2003-08-29
Points: 0

Thanks!

trembovetski
Offline
Joined: 2003-12-31
Points: 0

Some of the changes look a bit strange to me.
Take this one:

for (int i = 0; i < d3dNumTestLines * 4; i += 4) {

to

int i;
for (i = 0; i < d3dNumTestLines * 4; i += 4) {

Now why would this (for (int i=..)) not work? This is just pure C++, right? What was the error there?

Dmitri

atripp
Offline
Joined: 2003-07-15
Points: 0

Looks like the scope of variables declared inside a for loop has changed for MSVC 2005:

http://msdn2.microsoft.com/en-us/library/84wcsx8x.aspx

trembovetski
Offline
Joined: 2003-12-31
Points: 0

Indeed. Thanks for digging this out.

Dmitri

m_r_atkinson
Offline
Joined: 2003-08-29
Points: 0

Here is a complete list of the changes I've made so far to the source to get it to compile (sorry it is so long!):

in unicowsloader.h

#define JNU_NewStringPlatform(env, x) env->NewString((const jchar *)x, static_cast(_tcslen(x)))
#define JNU_GetStringPlatformChars(env, x, y) (LPWSTR)env->GetStringChars(x, y)
#define JNU_ReleaseStringPlatformChars(env, x, y) env->ReleaseStringChars(x, (const jchar *)y)

in dxInit.cpp

static int dxInitialized = false;

in D3DRuntimeTest.cpp line 242

change

for (int i = 0; i < d3dNumTestLines * 4; i += 4) {

to

int i;
for (i = 0; i < d3dNumTestLines * 4; i += 4) {

in d3dUtils.cpp line 258

change

for (int t = TR_OPAQUE_IDX; t < TR_MAX_IDX; t++) {

to

int t;
for (t = TR_OPAQUE_IDX; t < TR_MAX_IDX; t++) {

awt_Button.cpp line 91

change

labelStr = env->GetStringChars(label, JNI_FALSE);

to

labelStr = (LPCWSTR)env->GetStringChars(label, (jboolean *)JNI_FALSE);

awt_Button.cpp line 113

change

env->ReleaseStringChars(label, labelStr);

to

env->ReleaseStringChars(label, (const jchar *)labelStr);

awt_Checkbox.cpp line 91:

change
labelStr = env->GetStringChars(label, 0);

to
labelStr = (LPCWSTR)env->GetStringChars(label, (jboolean *)0);

awt_Checkbox.cpp line 108:

change
env->ReleaseStringChars(label, labelStr);

to
env->ReleaseStringChars(label, (const jchar*)labelStr);

awt_Component.cpp line 2406:

change

for (DWORD i = 0; i < rgndata->rdh.nCount; i++, r++) {

to
DWORD i;
for (i = 0; i < rgndata->rdh.nCount; i++, r++) {

awt_Desktop.cpp line 45:

change
const WCHAR* uri_c = env->GetStringChars(uri_j, JNI_FALSE);
const WCHAR* verb_c = env->GetStringChars(verb_j, JNI_FALSE);

HINSTANCE retval = ShellExecuteW(NULL, verb_c, uri_c, NULL, NULL, SW_SHOWNORMAL);

to
const jchar* uri_c = env->GetStringChars(uri_j, (jboolean *)JNI_FALSE);
const jchar* verb_c = env->GetStringChars(verb_j, (jboolean *)JNI_FALSE);

HINSTANCE retval = ShellExecuteW(NULL, (LPCWSTR)verb_c, (LPCWSTR)uri_c, NULL, NULL, SW_SHOWNORMAL);

awt_Desktop.cpp line 45:

change

jstring errmsg = env->NewString((LPCWSTR)buffer, len);

to

jstring errmsg = env->NewString((const jchar *)buffer, len);

awt_FileDialog.cpp line 155:
change
title = env->NewString(&unicodeChar, 1);

to

title = env->NewString((const jchar *)&unicodeChar, 1);

awt_ImputTextInfor.cpp 172:

change
return env->NewString(lpStrW, cStrW);

to
return env->NewString((const jchar *)lpStrW, cStrW);

awt_List.cpp line 365:

change
for(int i = 0; i < nCount; i++) {

to
int i;
for(i = 0; i < nCount; i++) {

awt_TextArea.cpp line 219:

change
env->GetStringRegion(jStr, 0, static_cast(length - 1), string);

to
env->GetStringRegion(jStr, 0, static_cast(length - 1), reinterpret_cast(string) );

awt_TextArea.cpp line 962:

change
env->GetStringRegion(text, 0, length-1, buffer);

to
env->GetStringRegion(text, 0, length-1, (jchar*)buffer);

awt_TextComponent.cpp line 311:

change
result = env->NewString(buf, static_cast(wcslen(buf)));

to
result = env->NewString(reinterpret_cast(buf), static_cast(wcslen(buf)));

awt_TextComponent.cpp line 347:

change
env->GetStringRegion(text, 0, length, buffer);

to
env->GetStringRegion(text, 0, length, reinterpret_cast(buffer) );

awt_Unicode.cpp line 20:

change
env->GetStringRegion(jstr, 0, len, lpwstr);

to
env->GetStringRegion(jstr, 0, len, reinterpret_cast(lpwstr) );

awt_Window.cpp line 1542:

change
env->GetStringRegion(title, 0, length, buffer);

to
env->GetStringRegion(title, 0, length, reinterpret_cast(buffer) );

awt_Win32GraphicsEnc.cpp line 46

change
for (int i = 0; i < awt_numScreens; ++i) {

to
int i;
for (i = 0; i < awt_numScreens; ++i) {

awt_Win32GraphicsDevice.cpp line 493:

change
for (int i = 0; i < rgbLength; ++i) {

to
int i;
for (i = 0; i < rgbLength; ++i) {

awt_TrayIcon.cpp line 660:

change
tooltipStr = env->GetStringChars(jtooltip, (jboolean *)NULL);
trayIcon->SetToolTip(tooltipStr);
env->ReleaseStringChars(jtooltip, tooltipStr);

to
tooltipStr = (LPCTSTR)env->GetStringChars(jtooltip, (jboolean *)NULL);
trayIcon->SetToolTip(tooltipStr);
env->ReleaseStringChars(jtooltip, (const jchar*)tooltipStr);

awt_TrayIcon.cpp line 779:

change
captionStr = env->GetStringChars(jcaption, (jboolean *)NULL);
textStr = env->GetStringChars(jtext, (jboolean *)NULL);
msgTypeStr = env->GetStringChars(jmsgType, (jboolean *)NULL);

trayIcon->DisplayMessage(captionStr, textStr, msgTypeStr);

env->ReleaseStringChars(jcaption, captionStr);
env->ReleaseStringChars(jtext, textStr);
env->ReleaseStringChars(jmsgType, msgTypeStr);

to
captionStr = (LPCTSTR)env->GetStringChars(jcaption, (jboolean *)NULL);
textStr = (LPCTSTR)env->GetStringChars(jtext, (jboolean *)NULL);
msgTypeStr = (LPCTSTR)env->GetStringChars(jmsgType, (jboolean *)NULL);

trayIcon->DisplayMessage(captionStr, textStr, msgTypeStr);

env->ReleaseStringChars(jcaption, (jchar*)captionStr);
env->ReleaseStringChars(jtext, (jchar*)textStr);
env->ReleaseStringChars(jmsgType, (jchar*)msgTypeStr);

ShellFolder2.cpp line 165:

change
return env->NewString( pStrret->pOleStr,
static_cast(wcslen(pStrret->pOleStr)));

to
return env->NewString( reinterpret_cast(pStrret->pOleStr),
static_cast(wcslen(pStrret->pOleStr)));

ShellFolder2.cpp line 171
change
#define JNU_NewStringPlatform(env, x) env->NewString(x, static_cast(_tcslen(x)))

to
#define JNU_NewStringPlatform(env, x) env->NewString( (jchar*)x, static_cast(_tcslen( (wchar_t*)x )))

ShellFolder2.cpp line 708:
change
wcsncpy( wszPath, strPath, nLength);
wszPath[nLength] = 0;
HRESULT res = pIShellFolder->ParseDisplayName(NULL, NULL,
const_cast(wszPath), NULL, &pIDL, NULL);

to
wcsncpy( reinterpret_cast(wszPath), reinterpret_cast(strPath), nLength);
wszPath[nLength] = 0;
HRESULT res = pIShellFolder->ParseDisplayName(NULL, NULL,
reinterpret_cast(wszPath), NULL, &pIDL, NULL);

ShellFolder2.cpp line 1089:
change
HINSTANCE libHandle = LoadLibrary(env->GetStringChars(libName, NULL));

to
HINSTANCE libHandle = LoadLibrary( (LPCWSTR)env->GetStringChars(libName, NULL));

m_r_atkinson
Offline
Joined: 2003-08-29
Points: 0

http://www.devx.com/cplus/10MinuteSolution/28908/1954?pf=true explains the change in Visual Studio 2005 to wchar_t, it is now a built in type so is incompatible with "unsigned short".

A single line change in jni.h to:

typedef wchar_t jchar;

will fix this problem, but I suspect that previous compiler versions will fail. The alternative is lots of casts at the call sites.

m_r_atkinson
Offline
Joined: 2003-08-29
Points: 0

The next compiler incompatibility bug is:

../../../src/windows/native/sun/awt/../java2d/windows/WindowsFlags.cpp(101) : error C2664: 'wcscat' : cannot convert parameter 2 from 'const jchar *' to 'const wchar_t *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

I've added a C-Style cast.

There are lots more of a similar sort. Most seem to be because LPCWSTR cannot be converted to jchar*

m_r_atkinson
Offline
Joined: 2003-08-29
Points: 0

The next bug is a compiler compatibility problem:

../../../src/windows/native/sun/windows/Hashtable.cpp(129) : error C2065: 'e' :
undeclared identifier
../../../src/windows/native/sun/windows/Hashtable.cpp(130) : error C2227: left o
f '->hash' must point to class/struct/union/generic type
type is ''unknown-type''
../../../src/windows/native/sun/windows/Hashtable.cpp(131) : error C2227: left o
f '->key' must point to class/struct/union/generic type
type is ''unknown-type''
../../../src/windows/native/sun/windows/Hashtable.cpp(132) : error C2227: left o
f '->value' must point to class/struct/union/generic type
type is ''unknown-type''
../../../src/windows/native/sun/windows/Hashtable.cpp(133) : error C2227: left o
f '->next' must point to class/struct/union/generic type
type is ''unknown-type''
make[4]: *** [C:/JDK_B8~1/tmp/sun/sun.awt/awt/obj/Hashtable.obj] Error 2

The fix is to replace line 112 with:

HashtableEntry* e;
for (e = table[index]; e != NULL; e = e->next) {

I'm going to bed before it compiles.

m_r_atkinson
Offline
Joined: 2003-08-29
Points: 0

I spoke too soon, now I'm getting

"make[5]: Entering directory `/cygdrive/c/jdk_b84/j2se/make/javax/swing/plaf'
make[5]: *** No rule to make target `C:/JDK_B8~1/classes/com/sun/java/swing/plaf
/windows/icons/Computer.gif', needed by `other_files'. Stop."

I'll do a clean build overnight.

m_r_atkinson
Offline
Joined: 2003-08-29
Points: 0

I've solved the msvcr80.dll problem. What you need to do is copy the *.*.manifest files from the C:\jdk_b84_output\tmp tree into C:\jdk_b84_output\bin directory.

After you do that you need to copy java.dll.manifest to the following files:
java.exe.manifest
javaw.exe.manifest
javac.exe.manifest
javah.exe.manifest
javadoc.exe.manifest
apt.exe.manifest

and for the other generated .exe files, then rerun the "make scsl" command.

I'm impressed, one day of effort and I've managed to build the jdk on a new compiler and run the jdk

m_r_atkinson
Offline
Joined: 2003-08-29
Points: 0

I have almost got the JDK to compile with MSVC 2005 Express

I am using "Microsoft DirectX SDK (April 2006)", "Microsoft Visual C++ 2005 Express Edition - ENU" and the "Windows® Server 2003 R2 Platform SDK Full Download".

my directory structure is:

C:
jdk_b84
jdk_b84_output
jdk_build_tools
DXSDK
jdk1.5.0_06
platform_sdk_2003
unicows
vs8
Common7
Microsoft MSDN 2005 Express Edition - ENU
Microsoft Visual C++ 2005 Express Edition - ENU
MSDN Express Library
SDK
VC
Xml

unicows.lib comes from C:\jdk_build_tools\platform_sdk_2003\lib

I have a setup.bat file:

set path=C:\tools;C:\cygwin\bin;C:\jdk_b84\jdk1.5.0_06\bin;C\windows;c:\windows\system32;
call vsvars32.bat
set ALT_BOOTDIR=C:\\jdk_build_tools\\jdk1.5.0_06
set ALT_OUTPUTDIR=C:\jdk_b84_output
set ALT_UNIXCOMMAND_PATH=C:\cygwin\bin
set ALT_COMPILER_PATH=C:\jdk_build_tools\vs8\VC\bin
set ALT_MSDEVTOOLS_PATH=C:\jdk_build_tools\vs8\VC\bin
set ALT_DXSDK_PATH=C:\jdk_build_tools\DXSDK
set ALT_DEVTOOLS_PATH=C:\tools
set ALT_CACERTS_FILE=C:\jdk_build_tools\cacerts
set ALT_MSVCRT_DLL_PATH=C:\Windows\System32
set ALT_MSVCR71_DLL_PATH=C:\Windows\System32
set ALT_MSVCP71_DLL_PATH=C:\Windows\System32
set ALT_UNICOWS_DLL_PATH=C:\jdk_build_tools\unicows
set ALT_UNICOWS_LIB_PATH=C:\jdk_build_tools\unicows
set MILESTONE=beta
set BUILD_NUMBER=b84
set SECURITY_BASELINE_142=1.4.2_10
set SECURITY_BASELINE_150=1.5.0_06

with vsvars32.bat as:

@SET VSINSTALLDIR=C:\jdk_build_tools\vs8
@SET VCINSTALLDIR=C:\jdk_build_tools\vs8\VC
@SET FrameworkDir=C:\WINDOWS\Microsoft.NET\Framework
@SET FrameworkVersion=v2.0.50727
@SET FrameworkSDKDir=C:\jdk_build_tools\vs8\SDK\v2.0
@set DevEnvDir=C:\jdk_build_tools\vs8\Common7\IDE
@set PATH=C:\jdk_build_tools\vs8\Common7\IDE;C:\jdk_build_tools\vs8\VC\BIN;C:\jdk_build_tools\vs8\Common7\Tools;C:\jdk_build_tools\vs8\SDK\v2.0\bin;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\jdk_build_tools\vs8\VC\VCPackages;%PATH%
@set INCLUDE=C:\jdk_build_tools\vs8\VC\INCLUDE;C:\jdk_build_tools\platform_sdk_2003\Include;C:\jdk_build_tools\platform_sdk_2003\Include\mfc;%INCLUDE%
@set LIB=C:\jdk_build_tools\platform_sdk_2003\Lib;C:\jdk_build_tools\vs8\VC\LIB;C:\jdk_build_tools\vs8\SDK\v2.0\lib;%LIB%
@set LIBPATH=C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

Two compiler options have to be added in C:\jdk_b84\hotspot\build\windows\makefiles\compile.make replacing the line:

CPP_FLAGS=$(CPP_FLAGS) $(MS_RUNTIME_OPTION)

with:

WARNINGS_OPTION = /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
CPP_FLAGS=$(CPP_FLAGS) $(WARNINGS_OPTION) $(MS_RUNTIME_OPTION)

and in C:\jdk_b84\j2se\make\common\Defs-windows.gmk

after:

# Always add _STATIC_CPPLIB definition
STATIC_CPPLIB_OPTION = /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _STATIC_CPPLIB
MS_RUNTIME_OPTION += $(STATIC_CPPLIB_OPTION)

add:

WARNINGS_OPTION = /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
MS_RUNTIME_OPTION += $(WARNINGS_OPTION)

There was one compiler error:
c:\jdk_b84\hotspot\src\os\win32\vm\perfMemory_win32.cpp(525) : error C2440: 'ini
tializing' : cannot convert from 'const char *' to 'char *'

which has an obvious fix.

I am still getting an error running java.exe
C:\jdk_b84_output\bin\client\jvm.dll seems to be being linked against MSVCR80.dll with is contained in the win64 libraries.

atripp
Offline
Joined: 2003-07-15
Points: 0

I'm trying to repeat this process on a vanilla Windows XP.I am also using "Microsoft DirectX SDK (April 2006)", "Microsoft Visual C++ 2005 Express Edition - ENU" and the "Windows® Server 2003 R2 Platform SDK Full Download".

My setup.bat file, which incorporates vsvars32.bat and runs the make:

echo off
rem
rem Root of Visual Developer Studio Common files.
set VSCommonDir=C:\PROGRA~1\MIAF9D~1\Common

rem
rem Root of Visual Developer Studio installed files.
rem
set MSDevDir=C:\PROGRA~1\MIAF9D~1\Common\msdev98

rem
rem Root of Visual C++ installed files.
rem
set MSVCDir=C:\PROGRA~1\MIAF9D~1\VC98

rem
rem VcOsDir is used to help create either a Windows 95 or Windows NT specific pa
th.
rem
set VcOsDir=WIN95
if "%OS%" == "Windows_NT" set VcOsDir=WINNT

set PATH=C:\dev\cygwin\bin;C:\dev\cygwin\usr\local\bin;C:\dev\cygwin\usr\bin
set PATH=%MSDevDir%\BIN;%MSVCDir%\BIN;%VSCommonDir%\TOOLS\%VcOsDir%;%VSCommonDir
%\TOOLS;%PATH%
set INCLUDE=%MSVCDir%\ATL\INCLUDE;%MSVCDir%\INCLUDE;%MSVCDir%\MFC\INCLUDE;%INCLU
DE%
set LIB=%MSVCDir%\LIB;%MSVCDir%\MFC\LIB;%LIB%

set VcOsDir=
set VSCommonDir=

set ALT_BOOTDIR=c:\\dev\\jdk1.5
set PATH=%ALT_BOOTDIR%\bin;%PATH%

set ALT_DEVTOOLS_PATH=c:\usr\bin

set ALT_DXSDK_PATH=c:\dev\dxsdk

set ALT_UNIXCOMMAND_PATH=\dev\cygwin\bin

set ALT_OUTPUTDIR=C:\dev\mustang\output
set ALT_COMPILER_PATH=C:\dev\vs8\VC\bin
set ALT_MSDEVTOOLS_PATH=C:\dev\vs8\VC\bin
REM set ALT_COMPILER_PATH=C:\Program Files\Microsoft VisualStudio\VC98\Bin
REM set ALT_MSDEVTOOLS_PATH=C:\Program Files\Microsoft VisualStudio\VC98\Bin
set ALT_DXSDK_PATH=C:\dev\dxsdk
REM set ALT_DEVTOOLS_PATH=C:\tools
REM set ALT_CACERTS_FILE=C:\jdk_build_tools\cacerts
REM set ALT_MSVCRT_DLL_PATH=C:\Windows\System32
set ALT_MSVCR71_DLL_PATH=C:\Windows\System32
set ALT_MSVCP71_DLL_PATH=C:\Windows\System32
set ALT_UNICOWS_DLL_PATH=c:\dev\mslu
REM set ALT_UNICOWS_LIB_PATH=c:\dev\mslu
set ALT_UNICOWS_LIB_PATH=c:\dev\psdk\Lib
set MILESTONE=beta
set BUILD_NUMBER=b84
set SECURITY_BASELINE_142=1.4.2_10
set SECURITY_BASELINE_150=1.5.0_06

echo %PATH%

set CLASSPATH=
set JAVA_HOME=
REM make all DEV_ONLY=true
REM make j2se_only DEV_ONLY=true
make scsl DEV_ONLY=true
----------
I'm getting these errors:
c:\dev\mustang\hotspot\src\share\vm\oops\constMethodOop.hpp(249) : error C2258:
illegal pure syntax, must be '= 0'
c:\dev\mustang\hotspot\src\share\vm\oops\constMethodOop.hpp(249) : error C2252:
'MAX_IDNUM' : pure specifier can only be specified for functions
c:\dev\mustang\hotspot\src\share\vm\oops\constMethodOop.hpp(250) : error C2258:
illegal pure syntax, must be '= 0'
c:\dev\mustang\hotspot\src\share\vm\oops\constMethodOop.hpp(250) : error C2252:
'UNSET_IDNUM' : pure specifier can only be specified for functions
c:\dev\mustang\hotspot\src\share\vm\oops\instanceKlass.hpp(724) : error C2039: '
MAX_IDNUM' : is not a member of 'constMethodOopDesc'
c:\dev\mustang\hotspot\src\share\vm\oops\constMethodOop.hpp(73) : see de
claration of 'constMethodOopDesc'
c:\dev\mustang\hotspot\src\share\vm\oops\instanceKlass.hpp(724) : error C2065: '
MAX_IDNUM' : undeclared identifier
c:\dev\mustang\hotspot\src\share\vm\oops\instanceKlass.hpp(725) : error C2039: '
UNSET_IDNUM' : is not a member of 'constMethodOopDesc'
c:\dev\mustang\hotspot\src\share\vm\oops\constMethodOop.hpp(73) : see de
claration of 'constMethodOopDesc'
c:\dev\mustang\hotspot\src\share\vm\oops\instanceKlass.hpp(725) : error C2065: '

I did make the makefile changes suggested above.
Any ideas as to what's causing these errors?

Thanks,
Andy

benjismith
Offline
Joined: 2006-05-13
Points: 0

Thanks, Kelly, for the additional information.

The "Express" label just means that it's free to download and install. And, yes, it's somewhat lesser than the "Professional" edition, but they've detailed the differences here:

http://msdn.microsoft.com/vstudio/products/compare/default.aspx

And I can't see anything that conclusively indicates that the actual underlying compiler is missing any include files or optimization options.

We'll see, though.

Sometime in the next few days, I'll see if I can successfully build the JDK, and I'll post a follow-up message here to let you know what happens.

Thanks again!!

--Benji

trembovetski
Offline
Joined: 2003-12-31
Points: 0

If I recall correctly, the compiler in the Express version doesn't support full optimization levels.

This means that you might need to tweak makefiles a bit..

Dmitri

pepe
Offline
Joined: 2003-06-10
Points: 0

Does it mean 'lower performance unless you tweak', or 'no compilation unless you tweak'?

trembovetski
Offline
Joined: 2003-12-31
Points: 0

I think it would be the latter. It would refuse to accept the optimization parameters.

Dmitri

pepe
Offline
Joined: 2003-06-10
Points: 0

Okay. i'll be installing VCExpress2005 to see if i manage to make it work. :'/
/me crosses fingers
Thanks for the information.

kellyohair
Offline
Joined: 2004-09-03
Points: 0

The Windows AMD64 builds using the April 2005 Platform SDK come pretty close to being Visual Studio .NET 2005, but I don't know anyone building 32bit with VS2005. The Mustang makefiles should detect you are using VS2005 and try and do the right thing compiler option wise.

Building on Windows XP should not be an issue.

I don't know what the "Express" label means on the VS2005 product, if that's less than what has been called "Professional", then you may have some problems building parts of the JDK due to missing include files or lib/dll files.

If you need to build Hotspot there could be some issues in terms of the optimizations butting heads with various instruction sequences. But I don't know of any unresolved problems at this time. When this kind of problem does crop up, I usually leave it to the talented VM engineers to track down, which can take time and usually results in turning the optimization down on certain files, or fixing a bad assumption about optimizations in the Hotspot code. Luckily this is a rare occurance.

I'd avoid building Hotspot if possible, and just use the latest Mustang jvm.dll files (Download a Mustang binary shapshot and set ALT_JDK_IMPORT_PATH to point to that jdk).

Hope this helps, I'm curious if anyone was able to use VS2005 too.

-kto