From e95b1a2f13d5efe385fb3b4246ff0ba805e87c99 Mon Sep 17 00:00:00 2001 From: Wong <19876688427> Date: Sat, 9 May 2020 23:15:34 +0800 Subject: [PATCH 1/2] =?UTF-8?q?java=E5=B8=B8=E7=94=A8=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compile-run-with-classpath/solution.sh | 2 ++ read-env-variable-system-property/solution.sh | 3 +++ system-out-system-err/solution.sh | 2 ++ 3 files changed, 7 insertions(+) diff --git a/compile-run-with-classpath/solution.sh b/compile-run-with-classpath/solution.sh index 292074f..3390297 100644 --- a/compile-run-with-classpath/solution.sh +++ b/compile-run-with-classpath/solution.sh @@ -7,3 +7,5 @@ # First argument is blank: true # Second argument is blank: true # Third argument is blank: false +javac -cp commons-lang-3.3.9.jar StringIsBlank.java +java -cp commons-lang-3.3.9.jar:. StringIsBlank.java '' ' ' '*' diff --git a/read-env-variable-system-property/solution.sh b/read-env-variable-system-property/solution.sh index 1dfb638..d0bbb61 100644 --- a/read-env-variable-system-property/solution.sh +++ b/read-env-variable-system-property/solution.sh @@ -6,3 +6,6 @@ # 使得该java命令输出: # Environment variable AAA: $A; # System property BBB: ' +export AAA = '$A;' +javac ReadEnvironmentVariableAndSystemProperty.java +java -DBBB="'" ReadEnvironmentVariableAndSystemProperty diff --git a/system-out-system-err/solution.sh b/system-out-system-err/solution.sh index 5cdeb2b..13d9256 100644 --- a/system-out-system-err/solution.sh +++ b/system-out-system-err/solution.sh @@ -2,3 +2,5 @@ # 请在这里编写两条命令: # 1. 在当前目录中,使用javac命令编译PrintSystemOutSystemErr.java # 2. 在当前目录中,使用java命令运行PrintSystemOutSystemErr,使其标准输出和标准错误都重定向到当前目录下一个名为output.txt的文件中 +javac PrintSystemOutSystemErr.java +java PrintSystemOutSystemErr > output.txt 2>&1 From 11053b261490bfc7e1769305b875f978246c7882 Mon Sep 17 00:00:00 2001 From: Wong <19876688427> Date: Sat, 9 May 2020 23:21:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?java=E5=B8=B8=E7=94=A8=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- read-env-variable-system-property/solution.sh | 2 +- system-out-system-err/solution.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/read-env-variable-system-property/solution.sh b/read-env-variable-system-property/solution.sh index d0bbb61..1c39993 100644 --- a/read-env-variable-system-property/solution.sh +++ b/read-env-variable-system-property/solution.sh @@ -8,4 +8,4 @@ # System property BBB: ' export AAA = '$A;' javac ReadEnvironmentVariableAndSystemProperty.java -java -DBBB="'" ReadEnvironmentVariableAndSystemProperty +java -cp . -DBBB="'" ReadEnvironmentVariableAndSystemProperty diff --git a/system-out-system-err/solution.sh b/system-out-system-err/solution.sh index 13d9256..05c947a 100644 --- a/system-out-system-err/solution.sh +++ b/system-out-system-err/solution.sh @@ -3,4 +3,4 @@ # 1. 在当前目录中,使用javac命令编译PrintSystemOutSystemErr.java # 2. 在当前目录中,使用java命令运行PrintSystemOutSystemErr,使其标准输出和标准错误都重定向到当前目录下一个名为output.txt的文件中 javac PrintSystemOutSystemErr.java -java PrintSystemOutSystemErr > output.txt 2>&1 +java -cp . PrintSystemOutSystemErr > output.txt 2>&1