Skip to content

Instantly share code, notes, and snippets.

@BlazerYoo
Last active October 20, 2021 03:20
Show Gist options
  • Save BlazerYoo/45afbe055b3861866096ac684ef7a5ff to your computer and use it in GitHub Desktop.
Save BlazerYoo/45afbe055b3861866096ac684ef7a5ff to your computer and use it in GitHub Desktop.
Compile and execute Java programs with one command
file_name=$1
echo Compiling $file_name...
javac $file_name
echo Successfully compiled $file_name.
echo Executing $file_name...
shift
java ${file_name%%.java} $@
file_name=$1
echo Compiling $file_name...
javac-introcs $file_name
echo Successfully compiled $file_name.
echo Executing $file_name...
shift
java-introcs ${file_name%%.java} $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment