编译OpenJDK8-u332:/bin/sh: 1: [: -a: unexpected operator/line 0: [: too many arguments

Posted 柳鲲鹏

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了编译OpenJDK8-u332:/bin/sh: 1: [: -a: unexpected operator/line 0: [: too many arguments相关的知识,希望对你有一定的参考价值。

  • 具体错误:
$ make all
/bin/sh: 1: [: -a: unexpected operator
/bin/sh: line 0: [: too many arguments
^C/home/wuxi/jdk8u-jdk8u332-ga//make/Main.gmk:203: recipe for target '/home/wuxi/jdk8u-jdk8u332-ga/build/linux-x86_64-normal-server-release/source_tips' failed
make: *** [/home/wuxi/jdk8u-jdk8u332-ga/build/linux-x86_64-normal-server-release/source_tips] 中断
  • 解决办法一

make时不要有任何参数。编译结果中没有images。这显然是不能满意的。

  • 解决办法二

使用老版本的make/common/MakeBase.gmk

  • 解决办法三

修改make/common/MakeBase.gmk,从319的define GetSourceTips一行开始,修改如下:

define GetSourceTips
	$(CD) $(SRC_ROOT) ; \\
    # TSIT: con't work ok.
	# if [ -d $(SCM_DIR) -a "$(SCM_VERSION)" != "" ] ; then \\
	#   $(ID_COMMAND) >> $@ ; \\
	# elif [ -f $(SCM_TIP_FILENAME) ] ; then \\
    #       $(SCM_TIP_FILECMD) >> $@ ; \\
	# fi;
 
	for i in $(REPO_LIST) IGNORE ; do \\
	  if [ "$$i" = "IGNORE" ] ; then \\
	    continue; \\
	  elif [ -d $$i/$(HG_DIRECTORY) -a "$(HG_VERSION)" != "" ] ; then \\
	    $(PRINTF) " %s:%s" \\
	        "$$i" `$(HG) id -i --repository $$i` ; \\
	  elif [ -f $$i/$(HGTIP_FILENAME) ] ; then \\
	    $(PRINTF) " %s:%s" \\
	        "$$i" `$(CAT) $$i/$(HGTIP_FILENAME)` ; \\
	  fi; \\
	done >> $@
	$(PRINTF) "\\n" >> $@
endef

以上是关于编译OpenJDK8-u332:/bin/sh: 1: [: -a: unexpected operator/line 0: [: too many arguments的主要内容,如果未能解决你的问题,请参考以下文章

OpenJDK8-u302-b03哪里去也?

redis编译报错 /bin/sh: cc: command not found

错误记录编译 Linux 内核报错 ( /bin/sh: 1: bison: not found )

ubuntu编译linux报错/bin/sh: 1: mkimage: not found

错误记录编译 Linux 内核报错 ( /bin/sh: 1: flex: not found )

开发板编译./camera显示-/bin/sh: ./camera: not found解决方案