In order to compile and run your Java code you should have Java Development Kit (JDK) installed for compilation of your Java code and Java Runtime Environment (JRE) for running your code. JDK already includes JRE. It means that if you installed JDK, then you do not have to install JRE.
Basic approach
- If you develop Java code, then you need JDK
- If you only run Java application (and do not compile), then you need JRE
JDK and JRE you can download from this site.
If you want to use multiple versions, you can try installing sdkman.
Silent install
Sometimes it is needed to install JDK (or JRE) silently (w/o user intervention). In this case, it is worth checking following articles:
- http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/silent.html
- http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/silent.html <- this one helped me to handle silent install of JRE 1.6