Since I need 64-bit Java on my computer for some other things, I have both versions and 64-bit is the one that's in the '%PATH%'.
Which was annoying as I had to edit batch files manually and correct the path each time after a Java upgrade.
So I ended up making an additional batch file 'get_java_home.bat', which takes '32' or '64' as an argument, finds the JavaHome from the registry and sets 'JAVA_HOME' variable accordingly. The script assumes that the Java version is the same for 32 and 64 bit java.
Then I changed RomRaider's batch files to use that script and resulting %JAVA_HOME% variable for starting javaw.exe:
Code:
@echo off
call get_java_home.bat 32
if errorlevel 1 (
echo Failed to set JAVA_HOME.
exit /b 1
)
:: Uncomment the line for the mode you wish to run. Comment all other lines.
:: Adjust path to javaw.exe as required for your Java system installation
start "" "%JAVA_HOME%\bin\javaw" -Djava.library.path=lib/windows -Dawt.useSystemAAFontSettings=lcd -Dswing.aatext=true -Dsun.java2d.d3d=true -Xms64M -Xmx512M -jar RomRaider.jar 1>>"%HOMEPATH%\.RomRaider\romraider_sout.log" 2>&1
:: Start Editor
I'm sure this can be further improved, but I hope this helps someone or even gets incorporated in RomRaider shipped batch files.