1

I am trying to run an application called vdbench on my windows2008R2 which is a VM. However, the application does not have 64 bit support and can be only run with 32 bit version of Java. I am trying to understand if I can install the 32 bit JRE and run the application on the windows2008R2 64 bit server? I tried it but the application is not able to run saying 'java' is not recognized as a program. I am wondering if I need to map my windows2008R2 to run the specific 32bit version of JRE?

skaffman
  • 398,947
  • 96
  • 818
  • 769
user050688
  • 13
  • 1
  • 1
  • 3
  • "The same applies for typed collections"... says who? – skaffman Aug 16 '11 at 19:38
  • Saying *'java' is not recognized as a program* means that `java.exe` wasn't find in PATH. It's just the Microsoftish confusing spelling of "command not found". – maaartinus Aug 16 '11 at 19:57

3 Answers3

7

You need to do nothing except install the 32-bit JRE / JDK whatever your requirement. I do this all the time. The only real reason to use the 64-bit version is if you application needs to be able to access more than 4GB of RAM (or some programmatic lib dependency)

Make sure you install the 32-bit version and point the JAVA_HOME environment variable to the install dir so if you install JRE 1.6 it JAVA_HOME should be something like
C:\Program Files (x86)\Java\jre1.6.0_XX

Also, in your Path environment variable add %JAVA_HOME%\bin to its end, this will make all the java executable's available at the command line.

In the case of a JRE you can use an environment variable called JRE_HOME if you want instead of JAVA_HOME.

Ali
  • 12,354
  • 9
  • 54
  • 83
  • where do I change the path environment variable from – user050688 Aug 16 '11 at 20:20
  • This has been asked on Stackoverflow before. Link: http://stackoverflow.com/questions/1492733/how-to-set-user-environment-variables-in-windows-server-2008-r2-as-a-normal-user – Ali Aug 16 '11 at 20:24
  • ok so I am running jre6. it is installed in C:\Program Files (x86)\Java\jre6. I changed the Java_Home environment variable but it still doesnt find the java. If i install the 64bit java version, it finds the executable but throws an error since it is not compatible. But its not able to find the 32 bit jre at all.. Im running this all through CLI – user050688 Aug 16 '11 at 20:43
  • 1
    Did you append %JAVA_HOME%\bin to your Path environment variable? – Ali Aug 16 '11 at 20:45
  • 1
    Yes I did.. even when I just type java at the CLI it doesnt find it..or throw any usage. – user050688 Aug 16 '11 at 20:50
  • Type `echo %PATH%` on the command line and see if the path to the java bin dir is present there. If it's not there, type `SET PATH=%PATH%;C:\Program Files (x86)\Java\jre6\bin` then type `java --version` and it should work, if this works, it means you did something wrong in setting up the environment variables. – Ali Aug 16 '11 at 21:00
  • I tried that as well and still its not able to find the path. if I cd to C:\Program Files (x86)\Java\jre6\bin and run java -version it works. But not from any other directory. Its still looking for it where the 64 bit would normall be installed.. – user050688 Aug 16 '11 at 21:45
  • is there an environment variable or variable in the path that points to the 64 bit java? – Ali Aug 16 '11 at 21:48
  • no there is nothing. could it be something in the system32 folder? – user050688 Aug 16 '11 at 21:54
  • I'm out of ideas without seeing the environment it would be hard to give any more help. Is the program executed from a command line? Perhaps you can write a bath file to execute it then. Even if it's an executable you double-click this will work. Or as the user below suggests use the 64-bit java executable with the `-d32` switch. – Ali Aug 16 '11 at 22:01
  • ok so I just changed the install directory from C:\Program Files (x86)\Java\jre6\bin to Program Files\Java\jre6\bin\ and it works now... seems like there is some underlying path somewhere in Windows which is pointing to 'Program Files' and not the x86 one.. I am not sure where to change that from.. but as long as its working now I am satisfied. Thanks for your help though – user050688 Aug 16 '11 at 22:14
1

You can also add -d32 to the JVM options, which should tell the JVM to run in 32-bit mode.

Jeremy Brooks
  • 589
  • 3
  • 12
0

You must install a 32-bit JDK or JRE. Then, add a new system environment variable named EXE4J_JAVA_HOME pointing to the new install dir (there's no need to overwrite the JAVA_HOME env. var.).

joninx
  • 1,775
  • 6
  • 31
  • 59