This commit is contained in:
krolxon 2024-02-18 23:40:06 +05:30
parent fec5f28159
commit 15f325d5c5
1 changed files with 12 additions and 4 deletions

View File

@ -1,6 +1,14 @@
#!/bin/env bash
# Script to run simple .java files.
# because its annoying to have .class files clutter your working directory;
if [ -z $* ]; then
echo "usage: jrun <filename>"
else
filename="${1%.*}"
\cp -f "$1" /tmp/"$1"
javac -d /tmp "$1"
java -cp /tmp "$filename"
fi