[setup] removed evil testing code hindering setting a JAVA_HOME
avoid copy construction and add const correctness