I've been trying to get my head around how the java platform works and what its components are.
On various forums I read explanations that are confusing me, e.g. "the JDK runs your java program",
while I thought the JRE does that. I think it's important to know what people are actually talking about.
I'll break my request down into two questions:
1. Is my general picture of the java platform correct?
JRE => specific instance of the JVM + JIT programs + java standard libraries
JDK => javac + JRE + console tool for accessing these features //maybe someother programs to help deploy your app
2. Is the version of the jre always the same as the jdk version?
I've seen people use jdk 1.6 and jre 1.6 as if there're the same thing.
Thanks in advance
The only good is knowledge and the only evil is ignorance. - Socrates
You will find a brief introduction to the Jlatform in the Java™ Tutorials. Click the "next" links.
You can have a JDK and JRE of different versions on the same computer; in fact you can have several JREs and several JDKs, and you can use different ones by altering the PATH you are using.
Thnx for the quick reply ^^
I already read the tutorial, but after reading so many different posts
I end up getting confused anyway. I'll look at the path more closely
now to see which jre im on; thnx for the tip.
1. Your general picture is correct. Somebody who writes "the JDK runs your Java program" is using sloppy language.
Note also the meanings of the acronyms:
JVM = Java Virtual Machine = the engine that interprets and executes Java bytecode
JRE = Java Runtime Environment = the complete car including its engine (the JVM) that adds libraries and other runtime support to run Java programs
JDK = Java Development Kit = the set of software that a programmer uses to develop Java software (the compiler and other tools)
2. Software compiled with an older JDK version should normally run also on a newer JRE. So, software compiled with for example JDK 1.5 should run unmodified on Java 6. (In practice there can be small things that make it incompatible, but Oracle is trying really hard to make newer Java versions 100% compatible with older versions).
The version numbering is a bit messy for historic reasons. There is a "developer version number" which is for example the 1.6.0 in "JDK 1.6.0". Then there is the "product version number" which is the 6 in "Java SE 6". JDK 1.6.0 is the JDK for Java SE 6. The Wikipedia page Java version history gives an overview of the names and version numbers of Java releases.