INSTALL JDK AND JRE
THE JRE
Java Runtime Environment: what it is and what it is used for.
JRE is an implementation of the Java Virtual Machine and is necessary for the execution of programs written in Java.
The Java Runtime Environment contains:
- the Java Virtual Machine (JVM)
- the standard Java API
- a launcher needed to launch programs already compiled in bytecode.
What is not…
- Is not a software development environment
- does not contain development tools
What does it contain?
The JRE contains:
java, javaw, libraries, rt.jar
THE JDK
JAVA DEVELOPMENT KIT: WHAT IS IT AND WHAT IS IT FOR
What does it contain?
In addition to the JRE and JVM, the JDK contains several tools including:
- javac: compile source file into bytecode
- java: executes files generated by the compiler
- javadoc: is used to create the basic documentation of the software, based on the comments included in the source code
- jar: manages jar files (Java Archive, compressed files containing Java classes)
- JConsole: equipped with a graphical interface, allows monitoring of Java applications
- jdb: java command line debugger
JDK INSTALLATION
Go with your browser to https://www.oracle.com/it/java/technologies/downloads/ and download the JDK for your operating system and architecture. I am currently working on a MacBook Pro computer with installed S.O. MacOS Ventura chip M2 and ARM 64 architecture. Once the JDK is installed, set the environment variable JAVA_HOME which must point to the folder where the JDK is installed. If everything was successful, open a terminal (or command prompt in Windows) and type java -version.You should see the version of Java installed.
DEVELOPMENT ENVIRONMENTS
There are several, the most widely used being Eclipse, NetBeans and others. In this course we will use Visual Studio code downloadable at https://code.visualstudio.com/. Choose the version for your operating system. Let us now see what extensions to install and how to write a simple welcome program.
Install the first extension, cascading others will be installed.
THE FIRST PROGRAM IN JAVA
Right now, let’s not worry too much about syntax. We will analyze everything well, what I want to point out is the print line instruction (println). We are basically telling Java uses the class System class to write to the output console (out) and uses the println to write something to the terminal.
Leave A Comment