aboutsummaryrefslogtreecommitdiffstats
path: root/mypath/runjv.sh
diff options
context:
space:
mode:
Diffstat (limited to 'mypath/runjv.sh')
-rwxr-xr-xmypath/runjv.sh17
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# 检查参数数量
4if [ $# -ne 1 ]; then
5 echo "请提供一个Java文件名作为参数"
6 exit 1
7fi
8
9filename=$1
10classname="${filename%.*}"
11javac "$filename"
12if [ $? -eq 0 ]; then
13 java "$classname"
14 rm "$classname.class"
15else
16 echo "Java文件编译失败!"
17fi