summaryrefslogtreecommitdiff
path: root/.local/bin/jrun
blob: 8445dd34290d9d982058d998c75d24059f24f804 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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