java runtime. What is the difference between JDK and JRE? What is JRE

I think it will be no secret to you that the development of most applications for the Android mobile platform is carried out primarily in the Java language. To create applications in Java, special software is required. The latest versions of this software can always be downloaded from the developer's website, oracle.com. This software includes tools such as and.

JRE (Java Runtime Environment)- this is a tool that represents a runtime environment - a minimal implementation of a virtual machine in which Java program code is launched and executed.

is a tool that represents a whole set of tools, an application development kit in the Java language. In fact, the JRE is included with the JDK, as are various other standard Java class libraries, the javac compiler, documentation, code examples, and various utility utilities. This entire set is distributed free of charge and has versions for different operating systems, so anyone who has a desire can download it and use it.

The JDK does not include an integrated development environment and is expected to be installed separately by the developer. There are a great variety of IDEs for Java development, for example: IntelliJ IDEA, Borland JBuilder, NetBeans, etc. To develop applications for Android, we choose Eclipse IDE. How to install JDK

. To install the JDK, you need to go to oracle.com, select the Downloads tab, then JAVA for developers. Or download from here: for Windows x32 - JDK-7u40-Windows-i586.exe file size - 123.46 Mb. For Windows x64 - JDK-7u40-Windows-x64.exe file size - 125.25 Mb. After you have downloaded the JDK you need, run the downloaded file and after some waiting you will see the start screen for installation. Click “”.

Next After you have downloaded the JDK you need, run the downloaded file and after some waiting you will see the start screen for installation. Click “ On the next screen you will be prompted for the installation directory. Click " " to install in the default directory or click on the “ button Change...

” and select your directory. Remember the path to the directory where you installed the JDK, it is highlighted in red in the figure: When installation Java Development Kit (JDK) almost finished, a form will appear in which you will be asked to install JRE (Java Runtime Environment) After you have downloaded the JDK you need, run the downloaded file and after some waiting you will see the start screen for installation. Click “”.

For a while you will see a screen with the following message (3 billion devices use Java):

Then you will see that the installation has finished:

At this point, the installation is almost complete. But there is one more step left to take - register the path to the JDK files in the operating system paths. This will allow us to run the main files from the command line. And also we will set the variable JAVA_HOME. On the Windows 7 operating system this is done as follows: In the “ menu Start"find the item" Computer” and right-click on it. A menu will appear, select “ Properties" A window will appear:

Select the item “ Advanced System Settings" A window will appear in which we select the item “ Environment Variables”.

In the window that appears, you need to create a variable – “ JAVA_HOME" And edit the variable “ Path" To do this, click the “ Create”.

Option to set the variable “ JAVA_HOME” is shown in the figure. This is where the line I suggested you remember when installing the JDK comes in handy.

Setting the variable “ Path“most likely there is no need to create it - it usually already exists. If not, then in the list of system variables we look for the variable “ Path» click on it, enter an additional path there C:\Program Files\Java\jdk1.7.0_07\bin and click " OK"(be very careful - here you need to enter a line after putting " ; ” at the end of the list of all paths and you also need to add the line “ \bin" after.



What Java integrated environments exist today? Java Runtime Environment (JRE) is the minimal implementation of a virtual machine required to run Java applications, without a compiler and other development tools. It consists of a virtual machine - the Java Virtual Machine and the Java class library JRF is distributed freely and can be downloaded from for most platforms Oracle website. The development tools along with the JRE are included in the JDK. Today, there are three main IDEs for development in Java: Eclipse, NetBeans and Intellij IDEA. Choosing for yourself which development environment is most convenient is not an easy task. And this choice may change over time. The complete NetBeans distribution out of the box supports Java (SE,ME,EE,Card,FX), C/C++,Groovy, PHP,HTML5. The capabilities of this IDE are impressive: there is immediate support for JavaEE, Spring Framework, Hibernate, OSGL, Maven, unit tests, the ability to develop desktop applications on the NetBeans platform and use cloud services. A separate advantage is that support for new versions of the specifications included in JavaEE initially appears in NetBeans. The main advantages of Eclipse are its extensibility, a huge community that develops a huge number of plugins and extensions, and support for almost all Java-related technologies. By its nature, Eclipse is a very heavyweight IDE, and it became possible to work comfortably with it starting from the Juno version. Intellij IDEA. The most famous commercial IDE for Java development. The IDE comes with a huge number of extensions that add support for almost all common Java technologies and more.

Principles of object-oriented programming(abstraction, hierarchy, responsibility, modularity)

Object Oriented Principles programming.Object-oriented programming has been developing for more than twenty years. There are several schools, each of which offers its own set of principles for working with objects and presents these principles in its own way. But there are several generally accepted concepts. Let's list them. Abstraction We have to abstract from some specific details of the object. It is very important to choose the right degree of abstraction. When describing the behavior of an object, such as a car, we build a model of it. Each model is described in the form of one or more classes(classes). A class can be considered a project, a cast, a drawing, according to which specific objects will then be created. The class contains a description of the variables and constants that characterize the object. They're called class fields(class fields). Procedures that describe the behavior of an object are called class methods(class methods). Inside a class you can describe and nested classes(nested classes) and nested interfaces. Fields, methods, and nested first-level classes are class members(class members). Different schools of object-oriented programming offer different terms, we use the terminology adopted in Java technology. Here is a sketch of the car description:

class Automobile(

int maxVelocity; // Field containing the highest speed of the car

int speed; // Field containing the current speed of the car

int weight; // Field containing the weight of the car

// Other fields...

void moveTo(int x, int y)( // Method simulating movement

// car. Parameters x and y are not fields

int a = 1; // Local variable is not a field

// Method body. The law is described here

// move the car to point (x, y)

// Other methods. . .

Hierarchy. The hierarchy of objects has long been used to classify them. It is worked out in particular detail in biology. Everyone is familiar with families, genera and species. We can describe our pets: cats, dogs, cows and others as follows:

class Pet( // Here we describe the general properties of all pets

Master person; // Animal owner

int weight, age, eatTimel]; // Weight, age, feeding time

int eat(int food, int drink, int time)( // Feeding process

// Initial actions...

if (time == eatTimefi]) person.getFood(food, drink);

// Food consumption method

void voice(); // Sounds made by animals

// Other...

Then we create classes that describe more specific objects, linking them to a general class:

class Cat extends Pet( // Describes properties unique to cats:

int mouseCatched; // number of mice caught

void toMouse(); // process of catching mice

// Other properties

class Dog extends Pet( // Dog properties:

void preserve(); // guard

Note that we are not repeating the common properties described in the Pet class. They are inherited automatically. We can define an object of the Dog class and use all the properties of the Pet class in it as if they were defined in the Dog class:

Dog tuzik = new Dog(), sharik = new Dog();

After this definition it will be possible to write

int p = sharik.eat(30, 10, 12);

And continue the classification like this:

class Pointer extends Dog( ... ) // Properties of the Pointer breed

class Setter extends Dog( ... ) // Setter properties

Responsibility. Our example only considers the feeding interaction described by the eat() method. In this method, the animal asks its owner to use the getFood() method. So, the sharik object, when executing its eat() method, sends a message to the object referenced in the person variable asking for a certain amount of food and drink. The message is written in the line person.getFood(food, drink). This message is Contract(contract) between objects, the essence of which is that the object sharik undertakes responsibility(responsibility) set the correct parameters in the message, and the object - the current value of person - assumes responsibility apply the getFood() feeding method, whatever it is. In order to correctly implement the principle of responsibility, the fourth principle of object-oriented programming is applied - modularity(modularity)

Modularity This principle states that each class should constitute a separate module. Members of a class that are not intended to be accessed externally must be encapsulated. In Java, encapsulation is achieved by adding the private modifier to the declaration of a class member. For example:

private int mouseCatched;

private String name;

private void preserve();

These class members become closed, they can only be used by instances of the same class, for example, tuzik can issue the sharik.preserve() instruction. And if in the Master class we write private void getFood(int food, int drink); then the getFood() method will not be found, and the unfortunate sharik will not be able to get food. In contrast to being closed, we can declare some members of a class open, by writing the public modifier instead of the word private, for example: public void getFood(int food, int drink); Such members can be accessed by any object of any class.

How Java 2 data types are classified. Declaring variables.

Java defines two categories of data:

 primitive types;

 reference types.

There is also a special null type, the null expression type, which has no name.

Primitive types are divided into Boolean types and numeric types. In turn, numeric types are integer types (byte, short, int, long and char) and real types (float and double). Reference types are types of classes, interfaces, and arrays.

Variable declarations in Java look like this:

type-name variable-identifier;

For example:

If several variables are of the same type, they can be declared in one sentence by listing the variable identifiers separated by commas:

type-name variable-identifier-1,variable-identifier-2,;

For example:

Coding conventions recommend starting variable identifiers with a lowercase letter. If the variable name consists of several words, then they are all written together, and each word, except the first, begins with a capital letter, for example:

double inputValue;

A variable is an indication of where the variable's value is stored in memory. A variable of a primitive type always holds the value of a variable of the specified type (for example, int), while a variable of a reference type stores a reference (address) of an object of the specified type.

You can create new variables anywhere in the program.

Logical type and operations with them (comparison and assignment operations, logical operations, abbreviated logical operations)

JavaScript has the following types of operations: Assignment operation assigns the left operand a value based on the right operand. The basic assignment operator is the equal sign (=), which assigns the left operand the value of the right operand. That is, x = y assigns the value y to the variable x.

Abbreviation Meaning
x += y x = x + y
x -= y x = x – y
x *= y x = x * y
x/=y x = x / y
x %= y x = x % y
x<<= y x = x<< y
x >>= y x = x >> y
x >>>= y x = x >>> y
x &= y x = x & y
x^=y x = x^y
x |= y x = x | y

Comparison operation compares operands and returns a Boolean value based on the validity of the comparison. Operands can be numbers, strings, booleans, and objects. Strings are compared based on standard lexicographic order using Unicode values.

Operation Description Examples that return true
Equal to (==) Returns true if the operands are equal. If the operands are of different types, JavaScript tries to convert the operands to a type that can be compared. 3 == var1 "3" == var1 3 == "3"
Not equal (!=) Returns true if the operands are not equal. If the operands are of different types, JavaScript tries to convert the operands to a type that can be compared. var1 != 4 var2 != "3"
Strictly equal (===) Returns true if the operands are equal and of the same type. 3 === var1
Strictly not equal (!==) Returns true if the operands are not equal and/or not of the same type. var1 !== "3" 3 !== "3"
More (>) Returns true if the left operand is greater than the right operand. var2 > var1
Greater than or equal to (>=) Returns true if the left operand is greater than or equal to the right operand. var2 >= var1 var1 >= 3
Less (<) Returns true if the left operand is less than the right operand. var1< var2
Less or equal (<=) Returns true if the left operand is less than or equal to the right operand.

Logical operations usually used with Boolean values; in this case, a Boolean value is returned. However, the && and || actually return the value of one of the specified operands, so if these operations are used on non-Boolean values, they may return a non-Boolean value.

Operation Usage Description
&& expr1 && expr2 (Logical AND) Returns expr1 if it can be converted to false; otherwise returns expr2. Thus, when used with Boolean values, && returns true if both operands are true; otherwise it returns false.
|| expr1 || expr2 (Logical OR) Returns expr1 if it can be converted to true; otherwise returns expr2. Thus, when used with Boolean values, || returns true if at least one of the operands is true; if both operands are false, returns false.
! !expr (Boolean NOT) Returns false if its only operand can be converted to true; otherwise returns true.

Since Boolean expressions are evaluated from left to right, they are checked to see if they can be executed "abbreviated" calculations according to the following rules:

false && anything abbreviated to false.

true || anything abbreviated to true.

Integer types and operations with them (arithmetic, type casting, comparison operations, bitwise operations, shift operations). Arithmetic operations take numeric values ​​(literals or variables) as operands and return a single numeric value. Standard arithmetic operations are addition (+), subtraction (-), multiplication (*), and division (/).

Operation Description Example
% (Modulus) Binary operation. Returns the integer remainder when two operands are divided. 12% 5 returns 2.
++ (Increment) Unary operation. Adds 1 to the operand. If used as a prefix (++x), adds one and returns the value of the operand; if used as a postfix (x++), returns the value of the operand and then adds one. If x is 3, then ++x sets x to 4 and returns 4; and x++ sets x to 4 and returns 3.
-- (Decrement) Unary operation. Subtracts one from the operand. The return value is the same as that for an increment operation. If x is 3, then --x sets x to 2 and returns 2; and x-- sets x to 2 and returns 3.
- (Unary negation) Unary operation. Returns the signed operand. If x is -3, then -x returns 3.

Bitwise operations treat their operands as a set of 32-bit binary numbers (zeros and ones), rather than as decimal, hexadecimal, or octal numbers. For example, the decimal number 9 has a binary representation of 1001. Bitwise operations are performed on such binary representations, but return standard JavaScript numeric values.

Operation Usage Description
Bitwise AND a & b Returns 1 at every bit position where the corresponding bits of both operands are 1.
Bitwise OR a | b Returns 1 at every bit position where the corresponding bits of one or both operands are 1.
Bitwise exclusive OR a ^ b Returns 1 at each bit position where the corresponding bits of one but not both operands are 1.
Bitwise NOT ~ a Inverts the bits of the operand.
Shift left a << b Shifts the binary representation of a by b bits to the left, padding the right side with zeros.

Bitwise Logical Operations

The operands are converted to 32-bit integers and expressed as a series of bits (0s and ones).

Each bit of the first operand corresponds to a paired bit of the second operand: the first bit to the first, the second to the second, and so on.

The operation is performed on each pair of bits, and the result is constructed bitwise. For example, the binary representation of 9 is 1001, and the binary representation of 15 is 1111. So, if the bitwise operation is applied to these two numbers, the results will be like this:
15 & 9 gives 9 (1111 & 1001 = 1001)

15 | 9 gives 15 (1111 | 1001 = 1111)

15^9 gives 6 (1111^1001 = 0110) Bitwise shift operations takes two operands: the first operand is the amount to be shifted, and the second specifies the number of bit positions by which the first operand is shifted. The direction of the shift is controlled by the operation applied

Real data type and operations with them. There are two real types in Java: float and double. They are characterized by bit depth, value range and representation accuracy, meeting the IEEE 754-1985 standard with some modifications. Three more values ​​are added to ordinary real numbers" 1. Positive infinity, expressed by the constant POSITIVE_INFINITY and arising when a positive value overflows, for example, as a result of the multiplication operation 3.0 * 6e307. 2. Negative infinity NEGATIVE_INFINITY. 3. “Not a Number”, written by the constant NaN (Not a Number) and arising when a real number is divided by zero or zero is multiplied by infinity. Examples of defining real types:

float x = 0.001, y = -34.789;

double 21 = -16.2305, z2;

Since all arithmetic operations and comparisons apply to real types, integer and real values ​​can be mixed in operations. In this case, the type casting rule is supplemented with the following conditions:

if in an operation one operand is of type double, then the other is cast to type double;

if one operand is of type float, then the other is cast to float;

otherwise, the integer conversion rule applies.

Assignment operations. Conditional operation.Simple assignment operation(simple assignment operator) is written with an equal sign =, to the left of which is a variable, and to the right an expression compatible with the type of the variable: x = 3.5, y = 2 * (x - 0.567) / (x + 2), b = x< у, bb = х >= y && b. The assignment operation works like this: the expression after the equal sign is evaluated and cast to the type of the variable to the left of the equal sign. The result of the operation will be the reduced value of the right side. The assignment operation has one more side effect: the variable on the left receives the reduced value of the right side, its old value is lost. In the assignment operation, the left and right sides are unequal; you cannot write 3.5 = x. After the operation x = y, the variable x will change, becoming equal to y, and after y = x, y will change. In addition to the simple assignment operation, there are 11 more composite compound assignment operators: +=, -=, *=, /=, %=, &=, |=, ^=,<<=, >>= ; >>>=. Characters are written without spaces; they cannot be rearranged.

All compound assignment operations follow the same pattern:

X op = a e equivalent x = (type x), i.e. (x or a).

Recall that the variable ind of type short is defined with the value 1. Assigning ind +=7.8 will result in the number 8, and the variable ind will receive the same value. This operation is equivalent to the simple assignment operation ind = (short)(ind + 7.8).

Before assignment, if necessary, a type cast is automatically performed. That's why:

b = b + 10; // Error!

b += 10; // Right!

Before the addition b + 50, b is promoted to type int, the result of the addition will also be of type int and, in the first case, cannot be Assigned to the variable b without an explicit type conversion. In the second case, before the assignment, the result of the addition will be narrowed to the byte type.

The conditional operator is the only one in JavaScript that takes three operands. It can give one or the other value based on the condition. The syntax is:

condition? val1 : val2
If condition is true, the operation has the value val1. Otherwise, the value is val2. You can use a conditional operator anywhere that a standard operator could be used.

For example,

status = (age >= 18) ? "adult" : "minor"

This statement assigns the value "adult" to the variable status if age is 19 or more. Otherwise, the variable status is assigned the value "minor".

20 answers

JRE- This Java runtime. It is a package of everything needed to run a compiled Java program, including the Java Virtual Machine (JVM), Java class library, java command, and other infrastructure. However, it cannot be used to create new programs.

JDK- This Java Development Kit, a full-featured SDK for Java. It has everything the JRE has, plus a compiler (javac) and tools (like javadoc and jdb). It is capable of creating and compiling programs.

Typically, if you only care about running Java programs on your computer, you install only the JRE. That's all you need. On the other hand, if you plan to get into Java programming, you'll need to install the JDK instead.

Sometimes, even if you don't plan to do Java development on your computer, you still need to install the JDK. For example, if you deploy a web application with JSP, technically you are just running Java programs on the application server. Why do you need JDK then? Because the application server converts JSPs into Java servlets and must use the JDK to compile the servlets. I'm sure there will be more examples.

The answer above (Pablo) is very correct. This is just additional information.

JRE, as the name suggests, is the environment. This is basically a set of directories with Java files, for example:

  • bin/ contains executable Java programs. The most important is java (and for Windows as well as javaw), which runs the JVM. There are some other utilities here as well, for example keytool and policytool.
  • conf/ contains user-editable configuration files for Java experts.
  • lib/ has a large number of support files: some .jar files, configuration files, properties files, fonts, translations, certificates, etc. - these are all Java "clippings". The most important are modules, a file that contains the .class of the Java Standard Library.
  • At some level, the Java standard library must call native code. For this purpose, the JRE contains some .dll (Windows) or .dylib (macOS) or .so (Linux) in bin/ or lib/ with the supported system binary.

JDK is also a collection of directories. This is an extended version of the JRE with some additions:

The JDK is a superset of the JRE and contains everything in the JRE, plus tools such as compilers and debuggers needed to develop applets and applications. The JRE provides libraries, the Java Virtual Machine (JVM), and other components for running applets and applications written in the Java programming language.

In layman's terms: JDK is the grandfather, JRE is the father, and JVM is their son. [those. JDK>JRE>JVM]

JDK = JRE + Development/Debugging Tools

JRE = JVM + Java Packages Classes (for example, util, math, lang, awt, swing, etc.) Libraries + runtime.

JVM = class loader system + runtime data area + runtime engine.

In other words, if you are a Java programmer, you will need JDK in your system and this package will also include JRE and JVM, but if you are a normal user who likes to play online games, then you will only need JRE and this package will not will have a JDK in it.

The Java Virtual Machine (JVM) is a virtual machine that runs Java bytecodes. The JVM doesn't understand Java source code, so you compile your *.java files to produce *.class files, which contain byte codes that the JVM can understand. It is also the essence that allows Java to be a "portable language" (write once, run anywhere). Indeed, there are specific JVM implementations for different systems (Windows, Linux, MacOS, see Wikipedia list...), the goal is that with the same bytecodes they all produce the same results.

JDK and JRE

To explain the difference between JDK and JRE, it is best to read the Oracle documentation and refer to the diagram:

Java Runtime Environment (JRE)

The Java Runtime Environment (JRE) provides libraries, the Java virtual machine, and other components for running applets and applications written in the Java programming language. In addition, the JRE includes two key deployment technologies: a Java plugin that allows applets to run in popular browsers; and Java Web Start, which deploys standalone applications over the network. It is also the foundation for technologies in the Java 2 Platform, Enterprise Edition (J2EE) for enterprise software development and deployment. The JRE does not contain tools or utilities such as compilers or debuggers for developing applets and applications.

When installation

The JDK is a superset of the JRE and contains everything in the JRE, plus tools such as compilers and debuggers needed to develop applets and applications.

Please note that Oracle is not the only one who provides the JDK.

From the official java website...

JRE (Java Runtime Environment):

  • It is an implementation of the Java* virtual machine that actually runs Java programs.
  • Java Runtime Environment is a plugin required to run Java programs.
  • The JRE is smaller than the JDK, so it requires less disk space.
  • JRE can be freely downloaded/supported https://www.java.com
  • It includes the JVM, Core, and other additional components for running applications and applets written in Java.

JDK (Java Development Kit)

One difference from the debugging perspective:

To debug in Java system classes such as String and ArrayList, you need a special version of the JRE that is compiled with "debugging information". The JRE included with the JDK provides this information, but the regular JRE does not. The regular JRE does not include this information to provide better performance.

What is debugging information? Here's a short explanation taken from this blog post:

Modern compilers do a pretty good job of transforming your high-level code, with its nice deferred and nested control structures and arbitrarily typed variables, into a big bunch of bits called machine code (or bytecode in the case of Java), the sole purpose of which should be to run as much as possible faster on the target CPU (virtual processor of your JVM). Java code is converted into multiple machine code instructions. Variables are moved all over the place - on the stack, in registers, or fully optimized. Structures and objects don't even exist in the resulting code - they're just an abstraction that gets translated into hard-coded offsets into memory buffers.

So how does the debugger know where to stop when you ask it to break down a write on some function? How do you manage to find what to show you when you give it the value of a variable? The answer is debugging information.

Debugging information is generated by the compiler along with the machine code. It is a representation of the relationship between the executable program and the original source code. This information is encoded into a predefined format and stored along with the machine code. Many of these formats have been invented over the years for different platforms and executables.

JRE is an acronym for Java Runtime Environment.It is used to provide a runtime environment. It is an implementation of the JVM. It physically exists. It contains a set of libraries and other files that the JVM uses during execution.

JDK is an acronym for Java Development Kit. He physically exists. It contains JRE+ development tools.

Typically, when you only care about running Java programs on your browser or computer, you will only install the JRE. That's all you need. On the other hand, if you plan to do some Java programming, you will also need the JDK.

JVM, JRE and JDK are platform dependent as the configuration of each OS is different. But Java is platform independent.

The Java Virtual Machine (JVM) is a runtime system that executes Java bytecode.

JRE is the environment (standard libraries and JVM) required to run Java applications.

Java R Runtime Environment (JRE)

The JRE provides the libraries, Java virtual machine, and other components needed to run applets and applications written in the Java programming language. This runtime can be redistributed across applications to make them independent.

Java Development Development Kit (JDK)

The JDK includes JRE plus command line development tools such as compilers and debuggers that are necessary or useful for developing applets and applications.

If you want to run Java programs but not develop them, download the Java Runtime Environment or JRE. If you want to develop them, download the Java Development Kit or JDK

JDK

Let the JDK be a set that includes what you need to develop and run Java applications.

The JDK is provided as a development environment for creating applications, components, and applets.

JRE

It contains everything you need to run Java applications in compiled form. You don't need libraries and other materials. Everything you need is included.

JVM, JRE, JDK are all the basis of the Java language. Each component works separately. Jdk and Jre physically exist, but Jvm is an abstract machine, meaning it does not physically exist.

JVM is a subsystem of the JDK and JRE that is used to validate intermediate code known as bytecode. It first loads a "class file" having a .c extension generated by the Java compiler (Javac) through the JVM subsystem class loader and classifies the memory locations (class area, stack, heap and machine registers) according to their usage. Then check all the bytecode to make sure it is returned to java and memory access for the entire network. Once the interpreter starts running, the interpreter checks the entire program line by line and finally the result is displayed in the console, browser and application through JRE (Java Runtime Environment) which provides the execution facilities.

JRE is also a subsystem of JDK which provides execution facilities like JVM, classes, executable file like .jar, etc.

JDK- It is a Java Development Kit containing all the necessary components that are used in programming such as class, methods, Swing, AWT, package, java (interpreter), javac (compiler), appletviewer (applet application viewer), etc. So, the final output is the content of each file which is useful while developing an application, standalone or web application.

If you Java programmer, you will need JDK on your system, and this package will also include the JRE and JVM, but if you normal user who loves to play online games, then you will only need JRE and there will be no JDK in this package.,

JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides a runtime environment in which Java bytecode can be executed.

JVMs are available for many hardware and software platforms. JVM, JRE and JDK are platform dependent as the configuration of each OS is different. But Java is platform independent.

It contains everything you need to run Java applications in compiled form. You don't need any libraries or anything. Everything you need is compiled.

The JRE cannot be used for development, it is only used to run applications.

Java SE Development Kit (JDK)

The JDK includes JRE plus command line development tools such as compilers and debuggers that are necessary or useful for developing applets and applications.

A clear understanding of these terms (JVM, JDK, JRE) is necessary to understand their usage and differences.

JVM The Java Virtual Machine (JVM) is a runtime system that executes Java bytecode. The JVM is like a virtual computer that can execute a set of compiled instructions and manipulate memory areas. When the Java compiler compiles source code, it generates a highly optimized set of instructions called bytecode in a .class file. The JVM interprets these bytecode instructions and converts them into machine code for execution.

When talking about the Java programming language, you can often see such abbreviations as: Java SE, JRE, JDK, IDE. Let's look at them.

Java SE

Java Standard Edition (Java SE)- this is the standard edition of Java, it is for it that client applications are developed and this site is entirely dedicated to Java SE. Applications can run independently or as web browser applets.

In addition to the standard edition there are:

  • Java Enterprise Edition (Java EE) for developing server-side applications such as Java Servlets, JavaServer Pages (JSP) and JavaServer Faces (JSF).
  • Java Micro Edition (Java ME) for developing applications for mobile devices such as phones.

JRE

Java Runtime Environment- Java runtime environment. This is a Java virtual machine required to run Java programs on user computers. It contains everything you need to run Java applications on your system. The JRE covers the needs of most users.

JDK

JDK (Java SE Development Kit)- a set of developer tools for creating programs in Java. Includes the JRE plus tools for developing, debugging and monitoring Java applications.

So, to decide what to download: JRE or JDK? Answer the question: do you want to only run Java programs or also develop them? If you just run it, then the JRE is enough for you. If you want to develop programs, then you need the JDK. The JDK development kit already includes the JRE, so there is no need to download them both separately.

Java versions

In addition to the various editions discussed, as well as different versions of the packages (for the end user and for the developer), there are numbered versions. Currently the current version is JDK 1.10. By the way, JDK 1.10 = JDK 10.

If you are interested in early releases (something like beta), then for the eleventh version you will find them at

IDE

IDE (integrated development environment)- integrated development environment, designed to assist the developer, speeds up the program development process. Typically includes an editor with syntax highlighting, help, automated compilation and program launch. An IDE can be created for any programming language, or for a specific language, such as Java. Integrated development environments are available free and paid. A good free IDE for Java is NetBeans.

The JDK set of programs and classes contains:

  • compiler javac from source text to bytecodes;
  • interpreter java, containing the JVM implementation;
  • lightweight interpreter jre(not available in latest versions);
  • applet viewer appietviewer, replacing the browser;
  • debugger jdt>;
  • disassembler javap;
  • archiving and compression program jar;
  • documentation collection program javadoc;
  • program javah generating C language header files;
  • program javakey adding an electronic signature;
  • program native2ascii, which converts binary files into text files;
  • programs rmic And rmiregistry for working with remote objects;
  • program seriaiver, which specifies the version number of the class;
  • libraries and header files of "native" methods;
  • Java class library API(Application Programming Interface).

Previous versions of the JDK also included debugging versions of executable programs: javac_g, java_g etc.

SUN Microsystems is constantly developing and updating the JDK, with new versions appearing every year.

In 1996, the first version of JDK 1.0 was released, which was modified to version number 1.0.2. In this version, the Java API class library contained 8 packages. The entire JDK 1.0.2 package came packaged in a single file, about 5 MB in size, and after unpacking it took up about 8 MB of disk space.

In 1997, version JDK 1.1 appeared, its last modification, 1.1.8, was released in 1998. This version had 23 class packages, it occupied 8.5 MB in packaged form and about 30 MB on disk.

In the first versions of the JDK, all Java API library packages were packaged into a single classes.zip archive file and called directly from this archive; it does not need to be unzipped.

The JDK toolset was then heavily redesigned.

JDK 1.2 was released in December 1998 and already contained 57 class packages. In archived form, this is a file of almost 20 MB in size and another separate file of more than 17 MB in size with packed documentation. The full version is located on 130 MB of disk space, of which about 80 MB is occupied by documentation.

Starting with this version, SUN began to call all its own Java technology products Java 2 Platform, Standard Edition, abbreviated as J2SE, and renamed JDK to Java 2 SDK, Standard Edition(Software Development Kit), abbreviated J2SDK, since it is still available Java 2 SDK Enterprise Edition And Java 2 SDK Micro Edition. However, the SUN company itself often uses the old name, and the name Java 2 has become established in the literature.

In addition to the 57 class packs required on any platform and called Core API, Java 2 SDK vl.2 includes additional class packages called the Standard Extension API. The Java 2 SDK SE, vl.3, released in 2000, already has 76 class packages that make up the Core API. In packed form, this is a file measuring about 30 MB, and another file with packed documentation measuring 23 MB. All this is unpacked into 210 MB of disk space. This version requires a Pentium 166 or higher processor and at least 32 MB of RAM.

Currently, JDK version 1.0.2 is no longer in use. Version JDK 1.1.5 with the AWT graphics library is built into the popular browsers Internet Explorer 5.0 and Netscape Communicator 4.7, so it is used to create applets. Java 2 technology is widely used in servers and client-server systems.

In addition to the JDK, SUN also separately distributes a set JRE(Java Runtime Environment).

What is JRE

The JRE set of programs and class packages contains everything needed to execute bytecodes, including the java interpreter (in previous versions, a lightweight interpreter jre) and a class library. This is part of the JDK and does not contain compilers, debuggers, or other development tools. It is the JRE or its analogue from other companies that is contained in browsers that can run programs in Java, operating systems and database management systems.

Although the JRE is included in the JDK, SUN also distributes this set as a separate file.

JRE version 1.3.0 is an archive file of about 8 MB in size, expanding into 20 MB of disk space.