我的环境: xp x32中文专业版. vs2010 en Professional cygwin2.867(32bit)
openjdk8 比 openjdk7 好编译很多. 首先它不依赖环境变量.而是改成了参数的方式,
jdk : jdk-7u7-windows-i586.exe 或者 x64
openjdk: openjdk-8-src-b132-03_mar_2014.zip
FreeType: ft255.zip
打开cmd cd openjdk-8-src-b132-03_mar_2014\openjdk
call "C:/Program Files/Microsoft Visual Studio 10.0/Common7/Tools/vsvars32.bat"
SET PATH=C:/Program Files/Java/jdk1.7.0_07;C:/Program Files/Microsoft Visual Studio 10.0/VC/bin;C:/cygwin/bin;%PATH%;
:: 这里注意一下 这个 path 的顺序不要随意改变, 保证 vc/bin 的目录在 cygwin之前, 因为 vc/bin 下有个link.exe cygwin 也有, 我们需要 vc 的link.exe , cygwin 要在 %PATH% 之前 因为编译中会用到 find.exe
我们要确保 用的是 cygwin中的find
bash
./configure --with-freetype=/cygdrive/D/myjdk/openjdk-8-src-b132-03_mar_2014/freetype --with-target-bits=32 --with-debug-level=fastdebug --with-num-cores=8
:: 这里的选项除了第一个其它的是可选项 然后它就可以配置了 等会 如果你看到下面的类似的内容 就成功了
Build performance summary:
* Cores to use: 7
* Memory limit: 8105 MB
* ccache status: not available for your system
WARNING: The result of this configuration has overridden an older
configuration. You *should* run 'make clean' to make sure you get a
proper build. Failure to do so might result in strange build problems.
bash
make CONF=windows-x86-normal-server-fastdebug 2>&1 | tee make.log
::等很久 我 i7 8g 的机器 大概需要 10-20分 如果你看到下面的类似的内容 就成功了
WARNING: The result of this configuration has overridden an older
configuration. You *should* run 'make clean' to make sure you get a
proper build. Failure to do so might result in strange build problems.
生成的结果在 : openjdk-8-src-b132-03_mar_2014\openjdk\build
编译中我的所有环境变量:
ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\Administrator\Application Data
CLIENTNAME=Console
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=xxxPC
ComSpec=C:\WINDOWS\system32\cmd.exe
DevEnvDir=C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\
DXSDK_DIR=C:\Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\
FP_NO_HOST_CHECK=NO
Framework35Version=v3.5
FrameworkDir=C:\WINDOWS\Microsoft.NET\Framework\
FrameworkDIR32=C:\WINDOWS\Microsoft.NET\Framework\
FrameworkVersion=v4.0.30319
FrameworkVersion32=v4.0.30319
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\Administrator
INCLUDE=C:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE;C:\Program Files\Microsoft Visual Studio 10.0\VC\ATLMFC\INCLUDE;C:\Program Files\Microsoft SDKs\Windows\v7.0A\include;
LIB=C:\Program Files\Microsoft Visual Studio 10.0\VC\LIB;C:\Program Files\Microsoft Visual Studio 10.0\VC\ATLMFC\LIB;C:\Program Files\Microsoft SDKs\Windows\v7.0A\lib;
LIBPATH=C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319;C:\WINDOWS\Microsoft.NET\Framework\v3.5;C:\Program Files\Microsoft Visual Studio 10.0\VC\LIB;C:\Program Files\Microsoft Visual Studio 10.0\VC\ATLMFC\LIB;
LOGONSERVER=\\xxxPC
NUMBER_OF_PROCESSORS=8
OS=Windows_NT
Path=C:/Program Files/Java/jdk1.7.0_07;C:/Program Files/Microsoft Visual Studio 10.0/VC/bin;C:/cygwin/bin;C:\Program Files\Microsoft Visual Studio 10.0\VSTSDB\Deploy;C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN;C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools;C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319;C:\WINDOWS\Microsoft.NET\Framework\v3.5;C:\Program Files\Microsoft Visual Studio 10.0\VC\VCPackages;C:\Program Files\HTML Help Workshop;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Performance Tools;C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools;C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin;C:\Python27\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Common Files\Adobe\AGL;C:\Program Files\010 Editor;C:\Documents and Settings\Administrator\Local Settings\Application Data\Kingsoft\WPS Office\9.1.0.4953\office6;C:\Program Files\IDM Computer Solutions\UltraEdit\;C:\Program Files\IDM Computer Solutions\UltraCompare\;C:\Program Files\IDM Computer Solutions\UltraFinder\;
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 60 Stepping 3, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=3c03
ProgramFiles=C:\Program Files
PROMPT=$P$G
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
TMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
USERDOMAIN=xxxPC
USERNAME=Administrator
USERPROFILE=C:\Documents and Settings\Administrator
VCINSTALLDIR=C:\Program Files\Microsoft Visual Studio 10.0\VC\
VS100COMNTOOLS=C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\
VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio 10.0\
windir=C:\WINDOWS
WindowsSdkDir=C:\Program Files\Microsoft SDKs\Windows\v7.0A\
生成vs2010 工程:
cmd \openjdk-8-src-b132-03_mar_2014\openjdk\hotspot\make\windows
set JAVA_HOME=D:\myjdk\openjdk-8-src-b132-03_mar_2014\openjdk\build\windows-x86-normal-server-fastdebug\jdk
call "C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\vsvars32.bat"
set PATH=%JAVA_HOME%\bin;C:\Program Files\Microsoft Visual Studio 10.0\VC\bin;C:\cygwin\bin;%PATH%
set HOTSPOTMKSHOME=c:\cygwin\bin
set MSC_VER=1600
create %JAVA_HOME%
等一会 出现类似下面的内容 表示成功了:
Writing .vcxproj file: D:\myjdk\openjdk-8-src-b132-03_mar_2014\openjdk\hotsp
ot\build\vs-i486\jvm.vcxproj
Done writing .vcxproj file.
Writing .vcxproj.filters file: D:\myjdk\openjdk-8-src-b132-03_mar_2014\openj
dk\hotspot\build\vs-i486\jvm.vcxproj.filters Done.
Writing .vcxproj.user file: D:\myjdk\openjdk-8-src-b132-03_mar_2014\openjdk\
hotspot\build\vs-i486\jvm.vcxproj.user Done.
生成在: openjdk-8-src-b132-03_mar_2014\openjdk\hotspot\build\vs-i486
打开 jvm.vcxproj 用vs2010 编译就好了.
note:
openjdk8要比openjdk7 好编译的多. openjdk7 需要设置很多环境变量, 而 8则改为了./configure 加参数的方式
jdk8 我的环境:
链接:http://pan.baidu.com/s/1mgh2nrE 密码:flrv