From 640b1f2568616755f4f92235a6aa57536ce1bf25 Mon Sep 17 00:00:00 2001 From: JiaXinWang61 <584937529@qq.com> Date: Wed, 2 Oct 2019 11:59:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?javac=E4=B8=8Ejava=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E7=BB=83=E4=B9=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compile-run-with-classpath/solution.sh | 3 +++ read-env-variable-system-property/solution.sh | 3 +++ system-out-system-err/solution.sh | 2 ++ 3 files changed, 8 insertions(+) diff --git a/compile-run-with-classpath/solution.sh b/compile-run-with-classpath/solution.sh index 292074f..5bc475e 100644 --- a/compile-run-with-classpath/solution.sh +++ b/compile-run-with-classpath/solution.sh @@ -1,4 +1,7 @@ #!/usr/bin/env sh +javac -classpath commons-lang3-3.9.jar StringIsblank.java +java -cp commons-lang3-3.9.jar:. StringIsblank "" '' '*' + # 请在这里编写两条命令: # 1. 在当前目录中,使用javac命令编译StringIsBlank.java # 2. 在当前目录中,使用java命令运行StringIsBlank,并传递三个参数:第一个参数是一个空字符串,第二个参数是一个空格,第三个参数是一个星号字符* diff --git a/read-env-variable-system-property/solution.sh b/read-env-variable-system-property/solution.sh index 1dfb638..fb75aff 100644 --- a/read-env-variable-system-property/solution.sh +++ b/read-env-variable-system-property/solution.sh @@ -1,5 +1,8 @@ #!/usr/bin/env sh # 请在这里编写三条命令: +export AAA='$A;' +javac ReadEnvironmentVariableAndSystemProperty.java +java -DBBB="'" ReadEnvironmentVariableAndSystemProperty # 1. 导出一个环境变量AAA,值是"$A;"(不包含双引号) # 2. 在当前目录中,使用javac命令编译ReadEnvironmentVariableAndSystemProperty.java # 3. 在当前目录中,使用java命令运行ReadEnvironmentVariableAndSystemProperty,并传递系统属性(System property)BBB,值为'(一个单引号) diff --git a/system-out-system-err/solution.sh b/system-out-system-err/solution.sh index 5cdeb2b..46346e7 100644 --- a/system-out-system-err/solution.sh +++ b/system-out-system-err/solution.sh @@ -1,4 +1,6 @@ #!/usr/bin/env sh # 请在这里编写两条命令: +javac PrintSystemOutSystemErr.java +java PrintSystemOutSystemErr>output.txt .2>&1 # 1. 在当前目录中,使用javac命令编译PrintSystemOutSystemErr.java # 2. 在当前目录中,使用java命令运行PrintSystemOutSystemErr,使其标准输出和标准错误都重定向到当前目录下一个名为output.txt的文件中 From f6d968e43fdfd210fb4d8c6d391817ad3c7df4ea Mon Sep 17 00:00:00 2001 From: JiaXinWang61 <584937529@qq.com> Date: Wed, 2 Oct 2019 12:06:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?javac=E4=B8=8Ejava=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E7=BB=83=E4=B9=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system-out-system-err/solution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-out-system-err/solution.sh b/system-out-system-err/solution.sh index 46346e7..9a6ff56 100644 --- a/system-out-system-err/solution.sh +++ b/system-out-system-err/solution.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh # 请在这里编写两条命令: javac PrintSystemOutSystemErr.java -java PrintSystemOutSystemErr>output.txt .2>&1 +java PrintSystemOutSystemErr >output.txt 2>&1 # 1. 在当前目录中,使用javac命令编译PrintSystemOutSystemErr.java # 2. 在当前目录中,使用java命令运行PrintSystemOutSystemErr,使其标准输出和标准错误都重定向到当前目录下一个名为output.txt的文件中