Update convenient-java.sh

improved logging and found a bug if the header is already there