7

I am running currently on Java 1.7.0_17 64bit version and I want to launch an app using Java 32 bit version.

I updated PATH variable to point to (C:\Program Files (x86)\Java\jre7\bin) Java 32 bit version. Then did a java -version it still shows the 64bit version.

I gave up and tried to do a java -d32 -jar abc.jar and then it gives me an

java -d32
Error: This Java instance does not support a 32-bit JVM.
Please install the desired version.

Please let me know how can the system refresh the latest Java settings done in the PATH variable.

1 Answer 1

7

There is probably a java.exe in your C:\WINDOWS\System32\ folder leftover from the previous installation. Replace it with the one in C:\Program Files (x86)\Java\jre7\bin.

Sign up to request clarification or add additional context in comments.

4 Comments

thanks. there are other related java exe's as well in the System32 folder. javaw.exe and javaws.exe should i replace them as well with Java 32 bit version. I am not sure if there are other related java files in the system 32 which I dont replace and the whole thing will be a mess. Or just replacing java.exe shuld do?
@Java You should replace all of them if you want the 32 bit java to be the default. Otherwise, you can execute java from its full path: C:\Program Files (x86)\Java\jre7\bin\java -version.
cygwin was driving my crazy with its own path's and escape characters. But it worked now. I still wonder when I change the PATH variable doesnt windows update it in system32. I wonder whats the point of updating the PATH if its not reflected accordingly. Does it need a system reboot or something?
@Java What you changed was the PATH environment variable to use your new Java installation's path. But Windows prioritizes the paths in PATH, first looking in system32 before anything else. If you used the windows installer to install Java, it most likely copied the java*.exe files to system32. The PATH environment variable is just a String, it doesn't execute anything.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.