如何检测系统中的java的版本是多少,检测系统java版本
如何检测系统中的java的版本是多少,检测系统java版本
# Check for the correct version of java
java_version := $(shell java -version 2>&1 |head -n 1 | grep '^java .*[ "]1\.6[\. "$$]')
ifneq ($(shell java -version 2>&1 | grep -iopenjdk),)
java_version :=
endif
ifeq ($(strip $(java_version)),)
$(info ************************************************************)
$(info You are attempting to build with the incorrectversion)
$(info of java.)
$(info $(space))
$(info Your version is: $(shell java -version2>&1 | head -n 1).)
$(info The correct version is: Java SE 1.6.)
$(info $(space))
$(info Please follow the machine setup instructionsat)
$(info$(space)$(space)$(space)$(space)http://source.android.com/source/download.html)
$(info************************************************************)
$(error stop)
endif
1.java_version :=
复习关于Make中关于赋值的操作符的区别
=
+=
:=
2.$(shell ...)
复习关于$符号在make文件中的2种使用方式
$(var) or${var}
$(strip) or${strip}
3.java -version 2>&1
复习关于2>&1 在这个地方指代什么内容
4.|
复习在bash中关于管道,输入输出重定向的使用
> <>> << 在命令行组合中的作用
5.head 命令
复习head命令在查看文件时的使用方法
head top catmore last 的区别
head -n number
head -cbyte_number
6.grep 命令
复习关于正则表达式的知识
^
.*
[]
\.
$$
''
7.ifneqifeq 在make文件中的使用
8.grep -i 忽略大小写
9.openjdk
10.strip函数在make文件中的使用
11.info 函数在make文件中的使用
12.error函数在make文件中的使用
下面关于javac的可以类别上面关于java的介绍
# Check for the correct version of javac
javac_version := $(shell javac -version 2>&1 |head -n 1 | grep '[ "]1\.6[\. "$$]')
ifeq ($(strip $(javac_version)),)
$(info************************************************************)
$(info You are attempting to build with the incorrectversion)
$(info of javac.)
$(info $(space))
$(info Your version is: $(shell javac -version2>&1 | head -n 1).)
$(info The correct version is: 1.6.)
$(info $(space))
$(info Please follow the machine setup instructionsat)
$(info $(space)$(space)$(space)$(space)http://source.android.com/source/download.html)
$(info************************************************************)
$(error stop)
endif
相关文章
- 暂无相关文章
用户点评