Skip to content

Instantly share code, notes, and snippets.

View gunlee01's full-sized avatar

Gunhee Lee gunlee01

View GitHub Profile
@djangofan
djangofan / get_home.bat
Created December 8, 2011 00:11
DOS batch file to find JAVA_HOME
@ECHO OFF
:: ------------------------------------------------------------------
:: JavaHome.bat - search for and set JAVA_HOME
:: 1. If JAVA_HOME is set in system environment, do nothing else.
:: 2. If javahome.txt already exists, use that value
:: 3. If those fail, search parent directories for java.exe
:: 4. Finally, try looking in the registry for other Java installations
:: Note- Script does not add trailing slash to JAVA_HOME variable
:: Note- JBINARY var can be set to JRE or JDK detection
:: ------------------------------------------------------------------