Sorry for the delay on this.  I'm working feverishly on putting out a
much-needed VirtualGL release, then I'll switch to working feverishly on
putting out a much-needed TurboVNC release.  I expected to have had
TurboVNC 2.2 beta out by now, but finishing libjpeg-turbo 2.0 beta
(which was a prerequisite) took way longer than expected.  Thanks for
your patience as well.  :)

DRC

On 3/26/18 1:37 PM, curts wrote:
> OK, I think I have it sorted now so it will work correctly for both
> 32-bit & 64-bit JAVA_HOME on 64-bit Windows 7. Thank your for your patience.
> 
> Curt
> 
> <code>
> @echo off
> setlocal enableextensions enabledelayedexpansion
> rem Find the 32-bit JRE
> if defined PROGRAMFILES(x86) (set "reg=%windir%\SysWOW64\reg") else set
> "reg=reg"
> set "branch=HKLM\Software\JavaSoft\Java Runtime Environment"
> 
> for /f "tokens=3" %%v in ('%reg% query "%branch%" /v "CurrentVersion" ^|
> find "REG_SZ"') do (
>     for /f "tokens=2*" %%I in ('%reg% query "%branch%\%%v" /v "JavaHome"
> ^| find "REG_SZ"') do (
>         set "JRE32=%%J"
>     )
> )
> echo Location of 32-bit java.exe: %JRE32%\bin
> 
> if DEFINED JAVA_HOME goto java_home_defined
> 
> set JAVA=java
> goto java_home_undefined
> 
> :java_home_defined
> if defined PROGRAMFILES(x86) goto java_home_64bit
> set JAVA_HOME=%JAVA_HOME:"=%
> if "%JAVA_HOME%"=="" (
>     set JAVA=java
> ) else (
>     set "JAVA=%JAVA_HOME%\bin\java.exe"
>     set "JAWT_PATH=%JAVA_HOME%\bin"
> )
> if DEFINED JAWT_PATH goto jawt_path_defined
> 
> :java_home_undefined
> rem This should work with Java 7 and later.
> for /f "delims== tokens=2,3*" %%i in ('"%JAVA% -XshowSettings:properties
> -version 2>&1 | findstr sun.boot.library.path"') do set _TMP=?%%i
> set _TMP2=%_TMP:? =%
> if EXIST "%_TMP2%\jawt.dll" set JAWT_PATH=%_TMP2%
> if DEFINED JAWT_PATH goto jawt_path_defined
> 
> rem Maybe we're using Java 6?
> if EXIST "c:\Program Files\Java\jre6\bin\jawt.dll" set
> JAWT_PATH=c:\Program Files\Java\jre6\bin
> if DEFINED JAWT_PATH goto jawt_path_defined
> 
> echo WARNING: Could not find jawt.dll.  Some features may not work properly.
> goto start
> 
> :java_home_64bit
> rem Check for 64-bit JAVA_HOME
> if not "%JAVA_HOME:*Files\Java=%" == "%JAVA_HOME%" (
>     rem Cannot use 64-bit Java, unset JAVA_HOME
>     echo Unset 64-bit JAVA_HOME
>     set JAVA_HOME=
>     rem Use 32-bit JRE
>     set "JAVA=%JRE32%\bin\java.exe"
>     set "JAWT_PATH=%JRE32%\bin"
>     goto jawt_path_defined
> ) else (
>     rem JAVA_HOME is 32-bit Java
>     set "JAVA=%JAVA_HOME%\bin\java.exe"
>     set "JAWT_PATH=%JAVA_HOME%\bin"
> )
> 
> :jawt_path_defined
> echo JAWT_PATH=%JAWT_PATH%
> set PATH=%JAWT_PATH%;%PATH%
> echo jawt.dll path: %JAWT_PATH%
> goto start
> 
> :start
> "%JAVA%" -Dsun.java2d.d3d=false -Djava.library.path="%~d0%~p0java" -jar
> "%~d0%~p0java\VncViewer.jar" -reqarch x86 %*
> </code>
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "TurboVNC User Discussion/Support" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to turbovnc-users+unsubscr...@googlegroups.com
> <mailto:turbovnc-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/turbovnc-users/7f44a79a-87cc-4b7a-90e7-13a64a93861d%40googlegroups.com
> <https://groups.google.com/d/msgid/turbovnc-users/7f44a79a-87cc-4b7a-90e7-13a64a93861d%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"TurboVNC User Discussion/Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbovnc-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/turbovnc-users/50ebeed8-da9d-6595-8da4-3935e2e70397%40virtualgl.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to