windows10 下编译 openjdk8 jdk8u vs2015

源码:http://hg.openjdk.java.net/jdk8u/jdk8u
cygwin: http://www.cygwin.com
freetype: https://github.com/ubawurinna/freetype-windows-binaries
尝试多次msys2,由于路径问题放弃;cygwin有编码问题,自行解决;由于vs2017路径问题,暂时没有尝试
准备freetype: 根目录freetype 子目录lib、include
将github上解压到freetype 将里面win64重命名lib
在cygwin下

首先获取子目录代码

执行get_source.sh

然后
cd jdk8u
bash ./configure --with-freetype=/cygdrive/d/dev/freetype -with-target-bits=64 --with-tools-dir="/cygdrive/d/vs2015/VC/bin"  --with-toolchain-version=2015
如果路径中有Program Files (x86),使用mklink创建目录连接

第一次执行会失败
在 \jdk8u\build\windows-x86_64-normal-server-release\vs-env 下找到set-vs-env.sh
批量替换掉带Program Files (x86)的路径,指向mklink软链接的路径
然后修改jdk8u\common\autoconf generated-configure.sh
查找extract-vs-env.bat
修改如下
`      # Generate a DOS batch file which runs $VS_ENV_CMD, and then creates a shell
      # script (executable by bash) that will setup the important variables.
      EXTRACT_VC_ENV_BAT_FILE="$VS_ENV_TMP_DIR/extract-vs-env.bat"

      # Now execute the newly created bat file.
      # The | cat is to stop SetEnv.Cmd to mess with system colors on msys.
      # Change directory so we don't need to mess with Windows paths in redirects.
      cd $VS_ENV_TMP_DIR
      #cmd /c extract-vs-env.bat | $CAT
      cd $CURDIR

`
阻止重新生成extract-vs-env.bat,使其直接执行set-vs-env.sh

重新执行
bash ./configure --with-freetype=/cygdrive/d/dev/freetype -with-target-bits=64 --with-tools-dir="/cygdrive/d/vs2015/VC/bin"  --with-toolchain-version=2015

然后make images

修改:jdk8u\hotspot\make\windows\makefiles\compile.make 

搜索/WX 替换为/WX- ,防止vc++将编译警告视为错误

修改:\jdk8u\hotspot\make\windows\get_msc_ver.sh
if [ "x$FORCE_MSC_VER" != "x" ]; then

前面写入cl的版本 

FORCE_MSC_VER=1900

 

所有生成文件下在build\windows-x86_64-normal-server-release

 

 

 

备注:

windows下查看cmd的语言设置

chcp

chcp 65001  就是换成UTF-8代码页

chcp 936 可以换回默认的GBK

chcp 437 是美国英语  

由于windows下的jdk默认编码为gbk,所以在cygwin下所有关于javac的输出都是乱码

 

linux 下

locale

设置为中文

export LANG=zh_CN.UTF-8

英文

export LANG=en_US.UTF-8

转载于:https://my.oschina.net/thinkwithlinc/blog/2965709

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值