diff options
Diffstat (limited to 'mypath/runjv.sh')
-rwxr-xr-x | mypath/runjv.sh | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/mypath/runjv.sh b/mypath/runjv.sh deleted file mode 100755 index 56eaa05..0000000 --- a/mypath/runjv.sh +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # 检查参数数量 | ||
4 | if [ $# -ne 1 ]; then | ||
5 | echo "请提供一个Java文件名作为参数" | ||
6 | exit 1 | ||
7 | fi | ||
8 | |||
9 | filename=$1 | ||
10 | classname="${filename%.*}" | ||
11 | javac "$filename" | ||
12 | if [ $? -eq 0 ]; then | ||
13 | java "$classname" | ||
14 | rm "$classname.class" | ||
15 | else | ||
16 | echo "Java文件编译失败!" | ||
17 | fi | ||