java path to depend on env var

This fix ensures that the java path is switched for openjdk based on the environment variable JVM='openjdk' instead of the file path.