使用VS2017编译OpenJDK8(未成功)

Posted 柳鲲鹏

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用VS2017编译OpenJDK8(未成功)相关的知识,希望对你有一定的参考价值。

  VS2017目录结构有所变化,所以要进行一番修改。

  • 安装VS2017
  • 直接编译OpenJDK8报错
configure: Using default toolchain microsoft (Microsoft Visual Studio)
checking for link... /usr/bin/link
checking if the first found link.exe is actually the Cygwin link tool... yes
configure: The path given by --with-tools-dir does not contain a valid
configure: Visual Studio installation. Please point to the VC/bin or VC/bin/amd64
configure: directory within the Visual Studio installation
configure: error: Cannot locate a valid Visual Studio installation
make images
  • 修改vcvars64.bat

根据安装版本不同,目录有所差异:

C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build

C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\Build

@call "%~dp0vcvarsall.bat" x86 %*
set INCLUDE=%ProgramFiles(x86)%\\Microsoft SDKs\\Windows\\v7.1A\\Include;%INCLUDE%
set PATH=%ProgramFiles(x86)%\\Microsoft SDKs\\Windows\\v7.1A\\Bin;%PATH%
set LIB=%ProgramFiles(x86)%\\Microsoft SDKs\\Windows\\v7.1A\\Lib;%LIB%
set CL=/D_USING_V110_SDK71_;%CL%
set LINK=/SUBSYSTEM:CONSOLE,5.01 %LINK%
  • 修改vcvars32.bat
@call "%~dp0vcvarsall.bat" x86 %*
set INCLUDE=%ProgramFiles(x86)%\\Microsoft SDKs\\Windows\\v7.1A\\Include;%INCLUDE%
set PATH=%ProgramFiles(x86)%\\Microsoft SDKs\\Windows\\v7.1A\\Bin;%PATH%
set LIB=%ProgramFiles(x86)%\\Microsoft SDKs\\Windows\\v7.1A\\Lib;%LIB%
set CL=/D_USING_V110_SDK71_;%CL%
set LINK=/SUBSYSTEM:CONSOLE,5.01 %LINK%

以上是关于使用VS2017编译OpenJDK8(未成功)的主要内容,如果未能解决你的问题,请参考以下文章

VS2015编译OpenJDK8:找不到libcmt.lib的解决办法

VS2015编译OpenJDK8:找不到libcmt.lib的解决办法

VS2015编译的OpenJDK8,会崩溃

成功编译无错MAC OpenJDK8:Terminating app due to uncaught exception ‘NSInternalInconsistencyException‘

VS2017编译成功但是没有生成.exe文件

修改,编译,GDB调试openjdk8源码(docker环境下)