All you have top do is just write this:
bash Beep.sh Filename.java
that will then Compile and run the program without any other class files being generated.
They will be generated but they will be pushed to the /tmp/.java/classes
Directory.
#!/bin/bash | |
bin/mkdir -p /tmp/.java/classes 2> /dev/null | |
# Compile the program. | |
# | |
javac -d /tmp/.java/classes $0 | |
# Run the compiled program only if compilation succeeds. | |
# | |
[[ $? -eq 0 ]] && java -cp /tmp/.java/classes $(basename ${0%.*}) "$@" | |
exit |