Krolyxon
Commit 6d54be5

Branches

Refs →

dotfiles-x11.localbinjrun

14 lines · 294 B · Bourne Again Shell (bash)

1#!/bin/env bash
2
3# Script to run simple .java files.
4# because its annoying to have .class files clutter your working directory;
5
6if [ -z $* ]; then
7 echo "usage: jrun <filename>"
8else
9 filename="${1%.*}"
10 \cp -f "$1" /tmp/"$1"
11 javac -d /tmp "$1"
12 java -cp /tmp "$filename"
13fi
14