6

I installed new Java from https://www.java.com/en/ but I am little confused about where installer store the java folder. It is stored in Program Files (x86). I don't understand what it means. I would like to to use 64-bit architecture. Why is it installed in (x86) program folder? Is that mean I am using 32-bit java?

Čamo
  • 3,863
  • 13
  • 62
  • 114

1 Answers1

8

Yes, it appears that you have installed the 32 bit version of Java. You can verify this by opening a Command Prompt, changing to the bin directory of the Java install, and typing:

java -version

If you are running 64 bit Java 8 you would see something like this:

java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

You want to download the Windows version which is labelled Windows x64.

Here is a link where you can download it.

Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360
  • Console writes : `java version "1.8.0_66" Java(TM) SE Runtime Environment (build 1.8.0_66-b18) Java HotSpot(TM) Client VM (build 25.66-b18, mixed mode, sharing)` There is no 64-bit mark. – Čamo Jan 14 '16 at 02:41
  • Bingo. Then download the 64 bit version and off you go. You may also have to set some environment variables if you want the 64 bit version of Java to be your default on Windows. – Tim Biegeleisen Jan 14 '16 at 02:42
  • What should I do with that 32-bit version. I am not sure but some program needs 32-bit version. Can I have both? – Čamo Jan 14 '16 at 02:48
  • You definitely can have both 32 and 64 bit Java installed on the same machine. I have that setup, and I use each for different things. But you may need to adjust your environment variables to choose a default version for Windows to use. – Tim Biegeleisen Jan 14 '16 at 02:49
  • @Čamo you only need 32-bit if you use 32-bit DLLs, otherwise you are better off with the 64-bit JVM. – Peter Lawrey Jan 14 '16 at 02:51
  • 1
    So Java creates virtual machine. It would mean all programs (32/64-bit) using java do not care which architecture java actually use. So why do I need 32-bit version? – Čamo Jan 14 '16 at 04:11
  • @Čamo You are correct, a Java bytecode can run in either a 32 or 64 bit JVM. As Peter mentioned, the only instance where you would need to run in a 32 bit JVM is if you have a 32-bit DLL from a third party, q.v. [this SO article](http://stackoverflow.com/questions/13448761/running-32-bit-dll-on-64-bit-machine-in-java) for more information. – Tim Biegeleisen Jan 14 '16 at 04:18
  • I am not sure what means "third party". From which position(view) we are talking about third party. Third party from JVM view? Cause I use a lot of programs which runs as 32-bit. – Čamo Jan 14 '16 at 05:55
  • 1
    Think of a DLL a custom Windows program that be called by other programs (including Java) running in Windows. Because a DLL is native, it can be either 32 or 64 bit. Java must be able to "speak" to the DLL using the right language, and therefore you must use either a 32 or 64 bit JVM. Bytecode is independent of the instruction width, but DLLs are not. – Tim Biegeleisen Jan 14 '16 at 06:02
  • So if I run IDE as 64-bit and try to call Git which is 32-bit it could be problem? I am going to try it. – Čamo Jan 14 '16 at 06:12