猝死JVM--1_win10下构建HotSpot编译、调试工程-
努力努力再努力xLg
前言
从今天起,准备了很久的JVM
,慢慢的做好总结。嗯,从安装环境开始吧先。
编译环境说明
win10
-
cygwin
64位 (官网下载就行:cygwin ) -
freetype
2.7 vs2010
openjdk8
软件安装
首先安装好cygwin 64
:这是一个模拟·Linux
环境的。主要用于编译
在安装完之后,需要选择package
安装。
链接:https://pan.baidu.com/s/10jDrgE-44M2jSCtkLPEGdA
提取码:6p84
复制这段内容后打开百度网盘手机App,操作更方便哦
最好是安装我提供的版本。因为有很多很傻逼的版本问题!!!
以下:是必须要安装的。
Binary Name | Category | Package | Description |
---|---|---|---|
ar.exe | Devel | binutils | The GNU assembler, linker and binary utilities |
make.exe | Devel | make | The GNU version of the ‘make’ utility built for CYGWIN |
m4.exe | Interpreters | m4 | GNU implementation of the traditional Unix macro processor |
cpio.exe | Utils | cpio | A program to manage archives of files |
gawk.exe | Utils | awk | Pattern-directed scanning and processing language |
file.exe | Base | file | Determines file type using ‘magic’ numbers |
zip.exe | Archive | zip | Package and compress (archive) files |
unzip.exe | Archive | unzip | Extract compressed files in a ZIP archive |
free.exe | System | procps | Display amount of free and used memory in the system |
这里我直接点的下一步,默认选择的ALL。等待下载(千万不要选择ALL,因为这样会跳过很多必要的依赖导致编译JDK失败)
一定要按需选择安装!
搜索安装



启动

将cygwin
的安装路径下bin目录配置到环境变量path
中
如我的安装路径为:D:\develop\cygwin64\bin

安装vs2010
这里一定要注意的是:安装路径一定要是英文,并且一定不要有空格

第一次打开VS2010
请选择VC++
安装VS2010过程中需要注意的是,安装路径不要有空格。

编译freetype
使用VS2010
编译,选择解压好的freetype
路径下的freetype.sln
具体路径:D:\develop\freetype\freetype-2.7\builds\windows\vc2010\


右键项目。选择Properties

想编译64位的openjdk
,所以我这里需要64位的,在编译之前的检查中,我们不仅需要dll
文件还需要lib
文件,都是用同一个工程编译出的只是后缀不太一样。编译两次的时候只需要修改vs2010
的配置后缀就OK
了,注意在vs2010
的配置选中,选择X64的,编译的时候,请右键项目,build
,


build

编译freetype.dll


BUILD
编译完后得到.lib
和.dll
两个文件。在D:\develop\freetype\freetype-2.7\objs\vc2010\x64
下。

然后咱们在D:\develop\freetype\freetype-2.7
目录下创建lib文件夹,并将编译好的freetype.dll
和freetype.lib
复制到该目录。
在编译openjdk
之前会校验并用到freetype
下的include文件夹下的ft2build.h和lib文件夹下的freetype.dll和freetype.lib
文件。(后面会说到编译前的校验,会提到使用这几个文件的地方)
将这连个路径设置到Path
环境变量中。

编译openJDK
打开cygwin
,切换到解压的openjdk_8
的文件夹根目录

执行命令
./configure -with-freetype=/cygdrive/d/develop/freetype/freetype-2.7/ -enable-debug -with-target-bits=64 with_toolsdir="/cygdrive/d/develop/VS2010/VC/bin" --disable-ccache
妈妈鸭!!!终于编译好了
花了三天时间!!!

可以进行下面的make all
的最后一步了。编译过程可能很久,就要看你的机器性能了。我的垃圾电脑用了快三个小时。Made Fucker


真TMD 傻逼!

报错1:版本太老
猜测是因为当时JDK8
要求的版本是1.7
存在的Bug
,可以按照下面找到对应地方,修改成当前使用的cygwin
的版本。或者将IF
中的代码注释掉。


Could not succesfully extract the envionment variables needed for the VS setup.


日了🐶!!!!
参考:https://blog.csdn.net/ciqingloveless/article/details/81950308