sproketboy
sproketboy

Reputation: 9462

NSIS - Failing to run Java Application with 64 bit Java

My installer launches a batch file in -post. Under 32 bit this works fine but when I have 64 bit JVM installed I get this error:

'java' is not recognized as an internal or external command, operable program or batch file.

My guess is that since NSIS is 32 bit it does not see the 64 bit environment. If I run the batch file from the command prompt it works fine.

How can I get the environment vars for 64 bit Java and use them in my batch file?

Upvotes: 4

Views: 794

Answers (2)

Griffin
Griffin

Reputation: 842

I had the same problem you did! I followed this guy's advice

http://forum.ragezone.com/f428/add-fixing-java-recognized-internal-527269/

Basically, if I had to sum it up, look at your two Program Files. IT should be located somewhere in C:\Program Files (x86)\Java\jdk1.6.0_10\bin. But I would follow the directions in this link!

Upvotes: 1

morechilli
morechilli

Reputation: 9817

I assuming this is running under a 64bit flavour of windows.

64bit Windows does "clever" things for back compatibility with 32bit. Registry entries and file search paths get automatically diverted.

The command prompt you are using will be a 64bit command prompt.

To run the 32bit command prompt run %windir%\SysWoW64\cmd.exe. You should be able to reproduce your failure condition there. 32bit NSIS will launch the batch file in 32bit mode.

You need to identify how the java.exe file is found under 64bit. If you post your batch file here, there should be something reasonably obvious that is getting diverted.

Upvotes: 4

Related Questions