
- #LXFREE REQUIRES JAVA 32 BIT HOW TO#
- #LXFREE REQUIRES JAVA 32 BIT INSTALL#
- #LXFREE REQUIRES JAVA 32 BIT 64 BIT#
- #LXFREE REQUIRES JAVA 32 BIT 32 BIT#
and I do know that int is a 32 bits and long is 64 bits. 32bit - it really boils down to how the numbers are stored underneath the covers. In my day-to-day programming, I do not recall ever having to change something or think about something in a different way just because I was using the 64bit JRE (or targetting the 64bit JRE for that respect).įrom my understanding of 64bit vs. This prompted an unusual question today, does it matter if I use the 32bit or 64bit JRE bundle?įrom thinking back on it, I've installed both versions before and my normal toolchain plugs happily in (Eclipse). 'wmic path win32_shortcutfile where "name='%lnk:\=\\%'" get target /format:list 2^>NUL ^| find "="'Ģ>&1 "%$JAVA%\java.exe" -version | find /i "64-bit" >NUL & (įor /f "delims=" %%I in ('dir /s /b /o:n "%PF%\*java.I've been using Java for a while now, and my typical ritual of setting up a new dev machine requires the norm of downloading and installing the latest JDK from Oracle's site. If defined PROGRAMFILES(x86) (set "PF=%PROGRAMFILES(x86)%") else set "PF=%PROGRAMFILES%" Set "lnk=%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Java\About Java.lnk" If that's the case, then fall back to searching %PROGRAMFILES(x86)% for java.exe.
#LXFREE REQUIRES JAVA 32 BIT INSTALL#
And the installer has no option for the end user to forego creation of the start menu shortcuts.Īnyway, wmic path win32_shortcutfile can read the target of a shortcut.Īs commented below, the Start Menu shortcuts could point to the 64-bit install of Java. The shortcut should always point to the default instance of Java, even if there are multiple versions installed. Previous answer: How about scraping the location from the start menu shortcut? The shortcut should always be in the All Users Start Menu → Programs unless a user manually deletes it, which in nearly two decades of desktop support I can't say I've ever seen happen.

Set "branch=HKLM\Software\JavaSoft\Java Runtime Environment"įor /f "tokens=3" %%v in ('%reg% query "%branch%" /v "CurrentVersion" ^| find "REG_SZ"') do (įor /f "tokens=2*" %%I in ('%reg% query "%branch%\%%v" /v "JavaHome" ^| find "REG_SZ"') do (Įdit: Frank's solution is the correct one. If defined PROGRAMFILES(x86) (set "reg=%windir%\SysWOW64\reg") else set "reg=reg" Here's the same idea, but using %windir%\syswow64\reg.exe query to query the registry values in-line: OFF reg file and scraping it can be a bit cumbersome. The above script illustrates the correct idea, but exporting a. :: Delete temp "%TEMP_FILE_JAVA_REGISTRY_CONTENT%" /S /Q > NUL ON SET JAVA_RUNTIME_HOME=%JAVA_RUNTIME_HOME:"=% :: Determine the install directory of javaįOR /F "tokens=1* delims=" %%A IN ('TYPE "%TEMP_FILE_JAVA_REGISTRY_CONTENT%" ^| FIND "JavaHome"') DO SET JAVA_RUNTIME_HOME=%%B START /W %REGEDITLOC%REGEDIT /E "%TEMP_FILE_JAVA_REGISTRY_CONTENT%" "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"

:: Export java Runtime Keys from registry to a temporary file Set "TEMP_FILE_JAVA_REGISTRY_CONTENT=%~dp0java_runtime_environment.reg"

If defined PROGRAMFILES(x86) (set "REGEDITLOC=%windir%\SysWOW64\") else set "REGEDITLOC=" So the following Batch file should solve the above issue: OFF
#LXFREE REQUIRES JAVA 32 BIT 32 BIT#
If you use the 32 bit Version of regedit.exe you will find the registry keys which belong to the 32 bit Java Runtime Environment Installation.
#LXFREE REQUIRES JAVA 32 BIT 64 BIT#
The version specific directory naming is intentional and it does not indicate that the JRE install is static.Īs with the earlier releases, static JRE install is performed only if STATIC=1 option is passed (via command line or config file) by the user.Īs I found out the 64 Bit Java Runtime Installation does not override the registry keys of the 32 bit Version. Starting with JDK 8u20 release, the JRE will be installed in a version specific directory. But Java Runtime might not be installed in this directory.
#LXFREE REQUIRES JAVA 32 BIT HOW TO#
So any idea how to determine the location of the latest installed 32 Bit Java Runtime via DOS or vbs? This should also consider that a 64 Bit version might be installed in parallel on the system.Īn alternative might be a file search in the directory C:\Program Files (x86)\Java. I noticed that this contains only information regarding the 64 Bit Java Runtime. So I tried to write a DOS batch or VBS script to determine the location of the latest installed JRE 8 32 bit. Since some days the JRE is installed in a version specific directory.
