Using JRE vs JDK (installed JREs ?!) in Eclipse, which is better?

I just noticed that my Eclipse (Luna version) works on JRE instead of JDK. I was curious about this because my environment variables are set correctly, like! User-Variables! (JAVA_HOME and added to the PATH value).

I'm not an absolute beginner, so I know for sure that the JDK is for developers (as the name suggests), as well as the JRE. I'm just completely amazed that Eclipse, which is built for development, has access only to the runtime.

Maybe I'm wrong, and in the "installed JRE" configuration, it only gets access to things like the JVM, etc. and gets access to the JDK at another point ?!

I came across this while I try to solve the problem with parameter names from standard class methods (got arg0, arg1, etc.) and saw that javadoc was not attached.

Now I want to know whether to select JRE or JDK in Windows => Preferences => Java => Installed JREs? I dare to suggest that running a program with a configured JDK will slow it down because the JDK folder contains more data and therefore has a larger size. What is a β€œnormal” configuration ?!

I just want to set up Eclipse correctly and close my knowledge gap, which I obviously have in this context.

+8
java eclipse javadoc
source share
1 answer

It is probably best to set up the JDK for programming in Eclipse. Is it not that the JRE will not run your program, because it (including the executable JVM executable). The fact is that using the JDK will give you access to the source code for the JDK (and javadoc), which you most likely need.

In addition, you may need to develop for a specific version of Java, but run Eclipse with a different one. This is why Eclipse allows you to configure multiple Java JREs / JDKs. In addition, the JDK includes some other tools that you may need (compare the executables included in one and the other). So go with the JDK and leave the JRE for the users of your program.

Last thing. There is a misconception in your statement about incorrect program execution and the size of the JDK folder. In general, the size of a program is occupied by a disk that is not related to how β€œfast” or β€œslow” it will work. The speed of your program depends on too many things to mention here, but as part of your question it depends on the JVM executable and your code, and both will be the same if you go with the JDK or JRE.

+13
source share

All Articles