Download Java Virtual Machine

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
• A Java Virtual Machine (JVM) enables a set of
computer software programs and data
structures to use a virtual machine model for
the execution of other computer programs
and scripts. The model used by a JVM accepts
a form of computer intermediate language
commonly referred to as Java bytecode.
JVM, JRE, SDK,BYTECODE
Smitha N Pai
• A JVM can also implement programming
languages other than Java. For example, Ada
source code can be compiled to Java
bytecode, which may then be executed by a
JVM. JVMs can also be released by other
companies besides Sun (the developer of Java)
— JVMs using the "Java" trademark may be
developed by other companies as long as they
adhere to the JVM specification published by
Sun and to related contractual obligations
• Java was conceived with the concept of WORA:
"write once, run anywhere". This is done using
the Java Virtual Machine. The JVM is the
environment in which java programs execute. It is
software that is implemented on non-virtual
hardware and on standard operating systems
• Programs intended to run on a JVM must be
compiled into a standardized portable binary
format, which typically comes in the form of
.class files.
• The JVM, which is the instance of the 'JRE'
(Java Runtime Environment), comes into
action when a Java program is executed.
When execution is complete, this instance is
garbage collected. JIT is the part of the JVM
that is used to speed up the execution time.
JIT compiles parts of the bytecode that have
similar functionality at the same time, and
hence reduces the amount of time needed for
compiling.
• The JVM verifies all bytecode before it is
executed. This verification consists primarily of
three types of checks:
• Branches are always to valid locations
• Data is always initialized and references are
always type-safe
• Access to "private" or "package private" data
and methods is rigidly controlled.
• Code verification also ensures that arbitrary
bit patterns cannot get used as an address.
Memory protection is achieved without the
need for a memory management unit (MMU).
• A virtual machine (VM) is a software
implementation of a programmable machine,
where the software implementation is
constrained within another computer at a
higher or lower level of symbolic abstraction
• Bytecode is a term which has been used to
denote various forms of instruction sets
designed for efficient execution by a software
interpreter as well as being suitable for further
compilation into machine code
• The name bytecode stems from instruction sets
which have one-byte opcodes followed by
optional parameters. Intermediate
representations such as bytecode may be output
by programming language implementations to
ease interpretation, or it may be used to reduce
hardware and operating system dependence by
allowing the same code to run on different
platforms. Bytecode may often be either directly
executed on a virtual machine (i.e. interpreter),
or it may be further compiled into machine code
for better performance
• A bytecode program may be executed by
parsing and directly executing the instructions,
one at a time. This kind of bytecode
interpreter is very portable. Some systems,
called dynamic translators, or "just-in-time"
(JIT) compilers, translate bytecode into
machine language as necessary at runtime:
this makes the virtual machine unportable,
but doesn't lose the portability of the
bytecode itself.
• In computing, just-in-time compilation (JIT),
also known as dynamic translation, is a
method to improve the runtime performance
of computer programs
• Interpreted code is translated from a high-level
language to a machine code continuously during
every execution, whereas statically compiled code is
translated into machine code before execution, and
only requires this translation once.
• JIT compilers represent a hybrid approach, with
translation occurring continuously, as with
interpreters, but with caching of translated code to
minimize performance degradation. It also offers
other advantages over statically compiled code at
development time, such as handling of late-bound
data types and the ability to enforce security
guarantees.
• In a bytecode-compiled system, source code is
translated to an intermediate representation
known as bytecode. Bytecode is not the machine
code for any particular computer, and may be
portable among computer architectures. The
bytecode may then be interpreted by, or run on,
a virtual machine. A just-in-time compiler can be
used as a way to speed up execution of bytecode.
At the time the bytecode is run, the just-in-time
compiler will compile some or all of it to native
machine code for better performance.
• A common goal of using JIT techniques is to reach or
surpass the performance of static compilation, while
maintaining the advantages of bytecode interpretation:
Much of the "heavy lifting" of parsing the original source
code and performing basic optimization is often handled at
compile time, prior to deployment: compilation from
bytecode to machine code is much faster than compiling
from source. The deployed bytecode is portable, unlike
native code. Since the runtime has control over the
compilation, like interpreted bytecode, it can run in a
secure sandbox. Compilers from bytecode to machine code
are easier to write, because the portable bytecode
compiler has already done much of the work.
• JDK = Java Development Kit - if you want to develop or just compile Java
programs (*.java -> *.class -> *.jar)
JRE = Java Runtime Environment - if you want to execute a Java program
Just my simple descriptions:
J2SE = Java 2 Standard Edition - (JDK+JRE) - for common purposes for
example
on PCs
J2EE = Java 2 Enterprise Edition - AFAIK framework and methodology to
produce applications in 3-layer technology (robust applications)
J2ME = Java 2 Micro Edition - (JDK+JRE) - for small devices (cellular
phones, palmtops etc.)
SDK = Software Development Kit.
It follows some fundamental infos from Sun's website:
-------------------------J2SE
-------------------------The premier solution for rapidly developing and deploying mission-critical,
enterprise applications, J2SETM provides the essential compiler, tools,
runtimes, and APIs for writing, deploying, and running applets and
applications in the Java programming language.
•
-------------------------J2EE
-------------------------J2EETM technology and its component based model simplifies enterprise
development and deployment. The J2EE platform manages the infrastructure and
supports the Web services to enable development of secure, robust and
interoperable business applications. The J2EE platform is the foundation
technology of the Sun ONE platform and Sun's Web services strategy.
-------------------------J2ME
-------------------------A highly optimized Java runtime environment, J2METM technology specifically
addresses the vast consumer space, which covers the range of extremely tiny
commodities such as smart cards or a pager all the way up to the set-top
box, an appliance almost as powerful as a computer.
• 1. A JRE software package is needed to use Java
applications while a JDK software package is needed to
create Java applications
2. A JDK software package contains everything in a JRE
package along with the development tools
3. JREs are available for a much wider platform range
compared to JDK
4. The JDK is meant for programmers and software
developers while the JRE is for the common everyday
user
• 1. An SDK is a set of development tools that allow
applications to be created for certain software
packages or platforms; the JDK is the most widely used
SDK and is an extension of the SDK responsible for
writing and running Java programs.
• 2. An SDK includes sample code and technical notes or
other supporting documentation; the JDK includes
components that are a selection of programming tools.
•
• Java is a software platform that allows a unified code base for creating and
deploying applications across a wide range of operating systems. Prior to
Java, you would need to recompile, and even edit your code, in order to
make it run on another operating system. With Java, you can write a
program once, and be sure that it will run on a wide range of operating
systems, provided there is a JVM, or Java Virtual Machine, that executes
the Java application, and acts as a middle man between the application
and the operating system. The JVM is packaged along with a collection of
software, and referred to as a JRE, or Java Runtime Environment.
• The JRE not only contains the JVM, which is the most important software
in the package, but extra software as well, that extends the functionalities
of Java. This includes AWT, Swing, and a lot of other libraries that can be
used by Java applications.
•
• You can find a JRE for any operating system,
including those for smartphones, like Windows
Mobile and Google Android, and even standard
mobile phones. There are different specifications
for computers and mobile phones though, as
they do not share the same hardware, and
computer applications often do not run on
mobile phones
• 1. Java is a software platform, while JRE is a
software package.
• 2. JRE contains the necessary software for
running Java applications.
• 3. Java is the same, regardless of the operating
system, while the JRE differs.
•