16
6
My JAVA_HOME
on my dev machine - which is Windows 7 Pro 64 Bit - points to a 64-bit Java, and that's fine in general. However, I just installed a program - to wit, the FlashDeveloper IDE - for which this setting is not fine: a 32-bit Java is required instead, and the JAVA_HOME
setting prevents the 32-bit Java from being picked up.
So I'd like to unset JAVA_HOME
just before launching the Flash IDE.
One way to achieve this would be via a batch script.
But isn't there a better way? I searched the various tabs of the Windows Shortcut properties window for such an option but there doesn't seem to be any. (I did discover, however, a checkbox for running the program through the shortcut as Administrator
.) Any suggestions?
Update: Solution that worked for me
:: type "C:\Program Files (x86)\FlashDevelop\FlashDevelop.bat"
@ECHO OFF
SETLOCAL
REM Prevent wrong 64-bit JVM from being picked up:
SET JAVA_HOME=
CALL "%~dpn0.exe"
That will open up a command prompt which I can then just close. You can make the shortcut have the icon of the executable you're calling from the command prompt by instructing the shell via the shortcut properties to go looking for an icon inside the actual executable.
I couldn't get the solutions involving START
to work, which opens up a new cmd.exe
window on my machine when passed the following (no idea why):
start "C:\Program Files (x86)\FlashDevelop\FlashDevelop.exe"
Must say that my cmd.exe
is tuned - that might have an influence here and there.
Update regarding the start
issue: As can be learnt following the link in the comments, the start
command uses the first arguments in quotes as the title of the windows to be created … So when you pass a path in quotes, it'll be misinterpreted as the title of the new window. Workaround is to provide an explicit title as first argument, which may also be empty (start "" "some path\with spaces"
).
2
See http://stackoverflow.com/questions/72671/how-to-create-batch-file-in-windows-using-start-with-a-path-and-command-with-s for the start issue
– fglez – 2013-12-20T23:18:51.307