ported 1-dim exp-max to Java