19

I'm a little bit confused about the two different versions of Eclipse - 32/64bit.

As far as I know, Java bytecode (= build of your code) is platform independend. If a user runs your bytecode in a 32bit JRE, the code is executed in as a 32bit process, if a user runs your bytecode in a 64bit JRE, the code is exectued as a 64bit process.

Eclipse needs the JRE to run, cause it's written in Java. But why are there 32 and 64bit versions of Eclipse on the Eclipse download page if only the user's JRE version does matter?

Does a 64bit Eclipse version need a 64bit JRE or JDK? If yes ,why?


Second confusion: I understand the need for a 32 and 64 bit version of the JRE. But why are there 32 and 64 bit versions of the JDK if the resulting bytecode is platform independet?

Thank you

alapeno
  • 2,724
  • 6
  • 36
  • 53

2 Answers2

8

Eclipse relies on SWT, which is essentially native code. There will be quite a few DLLs etc. exists (in the plugins or features directories) that will be used by the 64-bit version, that are drastically different from the 32-bit version.

Rahul Borkar
  • 2,742
  • 3
  • 24
  • 38
7

It is not because of the running environment, it is because Eclipse uses some native stuff and must be run on corresponding JDK. The applications you are developing inside Eclipse can then be run on whatever JRE you have installed, just specify it in the settings.

JDK is a compiler and also a lot of other stuff. Many of them are native applications that need to be run corresponding platform.

Jakub Zaverka
  • 8,816
  • 3
  • 32
  • 48
  • Thanks, but I don't get it. If you do not develop Java applications with eclipse (but C++ for example) you don't need to have installed a JDK at all. So why do you say it is not about the JRE but about the JDK? – alapeno Mar 15 '12 at 20:22
  • In order to run the bytecode, you just need to install the correct JRE. But to _produce_ the bytecode, you need to call the compiler, which is a native application within JDK. There are more native applications inside JDK, such as header generator for the JNI, Javadoc generator and more. – Jakub Zaverka Mar 15 '12 at 20:30
  • If you install an IDE, it calls these applications for you, automatically. If you don't have it, then you must call them by yourself. – Jakub Zaverka Mar 15 '12 at 20:32
  • Thanks. To sum it up: Eclipse and the JRE are highly coupled and must be indentical regarding 32/64bit. But can I use a 64it Eclipse with a 32bit JDK and the other way round? I mean an IDE and a compiler are loosely coupled, aren't they? Other story: doesn't Eclipse use its own ECJ compiler by default and does not depend on a JDK at all? – alapeno Mar 15 '12 at 20:38
  • I actually tried it before. If you have 32-bit Eclipse, then you must run it on 32-bit JDK (and the same with 64-bit). You don't need to have JRE installed, because JDK already contains a JRE. Eclipse is a little bit special, because it uses some native functionality (so 32-bit Eclipse dlls would not be compatible with 64-bit JDK). – Jakub Zaverka Mar 15 '12 at 20:45
  • Yes, Eclipse uses their own compiler, but some other IDEs use javac. – Jakub Zaverka Mar 15 '12 at 20:49
  • @JakubZaverka the compilers are not native applications, but are normal java programs. The native bits are GUI components. – Thorbjørn Ravn Andersen Mar 12 '13 at 06:58