I build openjdk on windows and visual studo(all chinese version), a error ocurred(with hg diff)

柳鲲鹏 quantum6 at yeah.net
Fri Jul 30 23:30:06 UTC 2021


Enviroment: Windows 7 chinese version, Visual studio 2010 chinese version.



The error is:
D:\openjdk8\hotspot/make/windows/get_msc_ver.sh: line 65: [: 用于 x64 的 Microsoft (R) C/C++ 优化编译器 16: integer expression expected
/usr/bin/expr: syntax error
NMAKE : fatal error U1077: “sh”: 返回代码“0x2”
Stop.
make[3]: *** [Makefile:231: generic_build2] Error 2
make[2]: *** [Makefile:177: product] Error 2
make[1]: *** [HotspotWrapper.gmk:45: /cygdrive/d/openjdk8/build/windows-x86_64-normal-server-release/hotspot/_hotspot.timestamp] Error 2
make: *** [/cygdrive/d/openjdk8/make/Main.gmk:110: hotspot-only] Error 2



Fix(Maye be there is better code):

quantum6 at taishan:~/jdk8u/hotspot/make/windows$ hg diff
diff -r 91924b4ea982 make/windows/get_msc_ver.sh
--- a/make/windows/get_msc_ver.sh       Tue Jul 20 18:10:23 2021 +0100
+++ b/make/windows/get_msc_ver.sh       Sat Jul 31 07:29:36 2021 +0800
@@ -59,6 +59,8 @@
   echo "MSC_VER=$FORCE_MSC_VER"
 else
   MSC_VER_RAW=`cl 2>&1 | "$HEAD" -n 1 | "$SED" 's/.*Version[\ ]*\([0-9][0-9.]*\).*/\1/'`
+  MSC_VER_RAW=`cl 2>&1 | "$HEAD" -n 1 | "$SED" 's/.*编译器[\ ]*\([0-9][0-9.]*\).*/\1/'`
+  # MSC_VER_RAW=16.00.303109.01
   MSC_VER_MAJOR=`"$ECHO" $MSC_VER_RAW | "$CUT" -d'.' -f1`
   MSC_VER_MINOR=`"$ECHO" $MSC_VER_RAW | "$CUT" -d'.' -f2`
   MSC_VER_MICRO=`"$ECHO" $MSC_VER_RAW | "$CUT" -d'.' -f3`






Many thank and best regards


Liu Kunpeng.


More information about the jdk8u-dev mailing list