anchor.diff:  :: %~3 - /P to force prepending to %PATH%, or empty
   
   :shellenv.set.home
  -
   if defined %~1 goto :EOF
   
   :: Set all provided paths to %PATH%
  
positive.code: 
  :: This routine looks for the latest version of JDK or JRE installed on 
  :: the PC and sets the environment variable (JDK_HOME or JRE_HOME, 
  :: respectively) to the appropriate path. It considers all java versions 
  :: are installed by default under %ProgramFiles% and %ProgramFiles(x86)%.
  ::
  :: %~1 - one of them: JDK or JRE
  
  :shellenv.lookup.java
  
  set "%~1_HOME="
  for /f %%d in ( '
  	dir /b "%ProgramFiles%\Java" "%ProgramFiles(x86)%\Java" 2^>nul ^| findstr /i "%~1" ^| sort
  ' ) do if exist "%ProgramFiles%\Java\%%d" (
  	set "%~1_HOME=%ProgramFiles%\Java\%%d"
  ) else (
  	set "%~1_HOME=%ProgramFiles(x86)%\Java\%%d"
  )
  goto :EOF
  
  
negative.code: ::
  :: ========================================================================
  
  call :shellenv.lookup.java JDK_HOME jdk "Java Development Kit"
  call :shellenv.lookup.java JRE_HOME jre "Java Runtime Environment"
  
  if defined JDK_HOME (
  	call :shellenv.set.home JAVA_HOME "%JDK_HOME%"
  