Skip to content

Commit c31d0e4

Browse files
committed
added JAVA support
1 parent 3cf868a commit c31d0e4

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

run

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ clean_exe() {
7272
clean() {
7373
find . -type d -name "*.dSYM" -exec rm -rf {} \; 2>/dev/null
7474
find . -type f -name "*.out" -exec rm -rf {} \; 2>/dev/null
75+
find . -type f -name "*.class" -exec rm -rf {} \; 2>/dev/null
7576
find . -type f -name "tempCodeRunnerFile.*" -exec rm -rf {} \; 2>/dev/null
7677
rm -rf __pycache__ ./*.pyc
7778
}
@@ -158,6 +159,17 @@ run() {
158159
rm -rf ./"${FILE%%.*}.out"
159160
fi
160161

162+
elif [[ ${FILE#*.} == java ]]; then
163+
javac "$FILE"
164+
JCF=$(find . -type f -name "*.class" -mmin -1)
165+
JCF=${JCF:2}
166+
if [[ $COMPILE != true ]]; then
167+
java "${JCF%%.*}"
168+
fi
169+
if [[ $PERSISTENT != true ]]; then
170+
rm -rf ./"$JCF"
171+
fi
172+
161173
else
162174
_ERROR_UFTC_
163175
_EXIT_

0 commit comments

Comments
 (0)