<s>
A	O
Java	B-Language
virtual	I-Language
machine	I-Language
(	O
JVM	B-Language
)	O
is	O
a	O
virtual	B-Architecture
machine	I-Architecture
that	O
enables	O
a	O
computer	O
to	O
run	O
Java	B-Device
programs	O
as	O
well	O
as	O
programs	O
written	O
in	O
other	B-Language
languages	I-Language
that	O
are	O
also	O
compiled	O
to	O
Java	B-Language
bytecode	I-Language
.	O
</s>
<s>
The	O
JVM	B-Language
is	O
detailed	O
by	O
a	O
specification	O
that	O
formally	O
describes	O
what	O
is	O
required	O
in	O
a	O
JVM	B-Language
implementation	O
.	O
</s>
<s>
Having	O
a	O
specification	O
ensures	O
interoperability	O
of	O
Java	B-Device
programs	O
across	O
different	O
implementations	O
so	O
that	O
program	O
authors	O
using	O
the	O
Java	B-Language
Development	I-Language
Kit	I-Language
(	O
JDK	B-Language
)	O
need	O
not	O
worry	O
about	O
idiosyncrasies	O
of	O
the	O
underlying	O
hardware	O
platform	O
.	O
</s>
<s>
The	O
JVM	B-Language
reference	O
implementation	O
is	O
developed	O
by	O
the	O
OpenJDK	B-Language
project	O
as	O
open	B-Application
source	I-Application
code	I-Application
and	O
includes	O
a	O
JIT	O
compiler	O
called	O
HotSpot	B-Language
.	O
</s>
<s>
The	O
commercially	O
supported	O
Java	B-Device
releases	O
available	O
from	O
Oracle	B-Application
are	O
based	O
on	O
the	O
OpenJDK	B-Language
runtime	O
.	O
</s>
<s>
Eclipse	B-Language
OpenJ9	I-Language
is	O
another	O
open	B-Application
source	I-Application
JVM	B-Language
for	O
OpenJDK	B-Language
.	O
</s>
<s>
The	O
Java	B-Language
virtual	I-Language
machine	I-Language
is	O
an	O
abstract	O
(	O
virtual	O
)	O
computer	O
defined	O
by	O
a	O
specification	O
.	O
</s>
<s>
It	O
is	O
a	O
part	O
of	O
java	B-Language
runtime	I-Language
environment	O
.	O
</s>
<s>
The	O
garbage	B-General_Concept
collection	I-General_Concept
algorithm	O
used	O
and	O
any	O
internal	O
optimization	O
of	O
the	O
Java	B-Language
virtual	I-Language
machine	I-Language
instructions	O
(	O
their	O
translation	O
into	O
machine	B-Language
code	I-Language
)	O
are	O
not	O
specified	O
.	O
</s>
<s>
Any	O
Java	B-Device
application	O
can	O
be	O
run	O
only	O
inside	O
some	O
concrete	O
implementation	O
of	O
the	O
abstract	O
specification	O
of	O
the	O
Java	B-Language
virtual	I-Language
machine	I-Language
.	O
</s>
<s>
Starting	O
with	O
Java	B-Language
Platform	I-Language
,	I-Language
Standard	I-Language
Edition	I-Language
(	O
J2SE	B-Language
)	O
5.0	O
,	O
changes	O
to	O
the	O
JVM	B-Language
specification	O
have	O
been	O
developed	O
under	O
the	O
Java	B-Language
Community	I-Language
Process	I-Language
as	O
JSR	B-Language
924	I-Language
.	O
,	O
changes	O
to	O
the	O
specification	O
to	O
support	O
changes	O
proposed	O
to	O
the	O
class	B-Language
file	I-Language
format	I-Language
(	O
JSR	B-Language
202	I-Language
)	O
are	O
being	O
done	O
as	O
a	O
maintenance	O
release	O
of	O
JSR	B-Language
924	I-Language
.	O
</s>
<s>
The	O
specification	O
for	O
the	O
JVM	B-Language
was	O
published	O
as	O
the	O
blue	O
book	O
,	O
whose	O
preface	O
states	O
:	O
</s>
<s>
One	O
of	O
Oracle	B-Application
's	O
JVMs	B-Language
is	O
named	O
HotSpot	B-Language
;	O
the	O
other	O
,	O
inherited	O
from	O
BEA	O
Systems	O
,	O
is	O
JRockit	B-Language
.	O
</s>
<s>
Oracle	B-Application
owns	O
the	O
Java	B-Device
trademark	O
and	O
may	O
allow	O
its	O
use	O
to	O
certify	O
implementation	O
suites	O
as	O
fully	O
compatible	O
with	O
Oracle	B-Application
's	O
specification	O
.	O
</s>
<s>
One	O
of	O
the	O
organizational	O
units	O
of	O
JVM	B-Language
byte	O
code	O
is	O
a	O
class	O
.	O
</s>
<s>
A	O
class	O
loader	O
implementation	O
must	O
be	O
able	O
to	O
recognize	O
and	O
load	O
anything	O
that	O
conforms	O
to	O
the	O
Java	B-Language
class	I-Language
file	I-Language
format	O
.	O
</s>
<s>
Any	O
implementation	O
is	O
free	O
to	O
recognize	O
other	O
binary	O
forms	O
besides	O
class	B-Language
files	I-Language
,	O
but	O
it	O
must	O
recognize	O
class	B-Language
files	I-Language
.	O
</s>
<s>
Initialization	O
:	O
invokes	O
Java	B-Device
code	O
that	O
initializes	O
class	O
variables	O
to	O
their	O
proper	O
starting	O
values	O
.	O
</s>
<s>
Every	O
Java	B-Language
virtual	I-Language
machine	I-Language
implementation	O
must	O
have	O
a	O
bootstrap	O
class	O
loader	O
that	O
is	O
capable	O
of	O
loading	O
trusted	O
classes	O
,	O
as	O
well	O
as	O
an	O
extension	O
class	O
loader	O
or	O
application	O
class	O
loader	O
.	O
</s>
<s>
The	O
Java	B-Language
virtual	I-Language
machine	I-Language
specification	I-Language
does	O
not	O
specify	O
how	O
a	O
class	O
loader	O
should	O
locate	O
classes	O
.	O
</s>
<s>
The	O
JVM	B-Language
operates	O
on	O
specific	O
types	O
of	O
data	O
as	O
specified	O
in	O
Java	B-Language
Virtual	I-Language
Machine	I-Language
specifications	I-Language
.	O
</s>
<s>
The	O
earlier	O
JVM	B-Language
were	O
only	O
32-bit	O
machines	O
.	O
</s>
<s>
long	O
and	O
double	O
types	O
,	O
which	O
are	O
64-bits	B-Device
,	O
are	O
supported	O
natively	O
,	O
but	O
consume	O
two	O
units	O
of	O
storage	O
in	O
a	O
frame	O
's	O
local	O
variables	O
or	O
operand	O
stack	B-Application
,	O
since	O
each	O
unit	O
is	O
32	O
bits	O
.	O
</s>
<s>
(	O
Although	O
boolean	O
has	O
been	O
treated	O
as	O
a	O
type	O
since	O
The	O
Java	B-Language
Virtual	I-Language
Machine	I-Language
Specification	I-Language
,	O
Second	O
Edition	O
clarified	O
this	O
issue	O
,	O
in	O
compiled	O
and	O
executed	O
code	O
there	O
is	O
little	O
difference	O
between	O
a	O
boolean	O
and	O
a	O
byte	O
except	O
for	O
name	O
mangling	O
in	O
method	B-Language
signatures	O
and	O
the	O
type	O
of	O
boolean	B-Data_Structure
arrays	I-Data_Structure
.	O
</s>
<s>
booleans	O
in	O
method	B-Language
signatures	O
are	O
mangled	O
as	O
Z	O
while	O
bytes	O
are	O
mangled	O
as	O
B	O
.	O
Boolean	B-Data_Structure
arrays	I-Data_Structure
carry	O
the	O
type	O
boolean[]	O
but	O
use	O
8	O
bits	O
per	O
element	O
,	O
and	O
the	O
JVM	B-Language
has	O
no	O
built-in	O
capability	O
to	O
pack	O
booleans	O
into	O
a	O
bit	B-Data_Structure
array	I-Data_Structure
,	O
so	O
except	O
for	O
the	O
type	O
they	O
perform	O
and	O
behave	O
the	O
same	O
as	O
byte	O
arrays	O
.	O
</s>
<s>
In	O
all	O
other	O
uses	O
,	O
the	O
boolean	O
type	O
is	O
effectively	O
unknown	O
to	O
the	O
JVM	B-Language
as	O
all	O
instructions	O
to	O
operate	O
on	O
booleans	O
are	O
also	O
used	O
to	O
operate	O
on	O
bytes	O
.	O
)	O
</s>
<s>
However	O
the	O
newer	O
JVM	B-Language
releases	O
(	O
OpenJDK	B-Language
HotSpot	B-Language
JVM	B-Language
)	O
support	O
64-bit	B-Device
,	O
so	O
you	O
can	O
either	O
have	O
32-bit/64	O
-bit	O
JVM	B-Language
on	O
a	O
64-bit	B-Device
OS	I-Device
.	O
</s>
<s>
The	O
primary	O
advantage	O
of	O
running	O
Java	B-Device
in	O
a	O
64-bit	B-Device
environment	O
is	O
the	O
larger	O
address	O
space	O
.	O
</s>
<s>
This	O
allows	O
for	O
a	O
much	O
larger	O
Java	B-Device
heap	O
size	O
and	O
an	O
increased	O
maximum	O
number	O
of	O
Java	B-Device
Threads	O
,	O
which	O
is	O
needed	O
for	O
certain	O
kinds	O
of	O
large	O
applications	O
;	O
however	O
there	O
is	O
a	O
performance	O
hit	O
in	O
using	O
64-bit	B-Device
JVM	B-Language
compared	O
to	O
32-bit	O
JVM	B-Language
.	O
</s>
<s>
The	O
JVM	B-Language
has	O
a	O
garbage-collected	O
heap	O
for	O
storing	O
objects	O
and	O
arrays	O
.	O
</s>
<s>
Code	O
,	O
constants	O
,	O
and	O
other	O
class	O
data	O
are	O
stored	O
in	O
the	O
"	O
method	B-Language
area	O
"	O
.	O
</s>
<s>
The	O
method	B-Language
area	O
is	O
logically	O
part	O
of	O
the	O
heap	O
,	O
but	O
implementations	O
may	O
treat	O
the	O
method	B-Language
area	O
separately	O
from	O
the	O
heap	O
,	O
and	O
for	O
example	O
might	O
not	O
garbage	O
collect	O
it	O
.	O
</s>
<s>
Each	O
JVM	B-Language
thread	O
also	O
has	O
its	O
own	O
call	B-General_Concept
stack	I-General_Concept
(	O
called	O
a	O
"	O
Java	B-Language
Virtual	I-Language
Machine	I-Language
stack	B-Application
"	O
for	O
clarity	O
)	O
,	O
which	O
stores	O
frames	O
.	O
</s>
<s>
A	O
new	O
frame	O
is	O
created	O
each	O
time	O
a	O
method	B-Language
is	O
called	O
,	O
and	O
the	O
frame	O
is	O
destroyed	O
when	O
that	O
method	B-Language
exits	O
.	O
</s>
<s>
Each	O
frame	O
provides	O
an	O
"	O
operand	O
stack	B-Application
"	O
and	O
an	O
array	O
of	O
"	O
local	O
variables	O
"	O
.	O
</s>
<s>
The	O
operand	O
stack	B-Application
is	O
used	O
for	O
operands	O
to	O
computations	O
and	O
for	O
receiving	O
the	O
return	O
value	O
of	O
a	O
called	O
method	B-Language
,	O
while	O
local	O
variables	O
serve	O
the	O
same	O
purpose	O
as	O
registers	B-General_Concept
and	O
are	O
also	O
used	O
to	O
pass	O
method	B-Language
arguments	O
.	O
</s>
<s>
Thus	O
,	O
the	O
JVM	B-Language
is	O
both	O
a	O
stack	B-Application
machine	I-Application
and	O
a	O
register	B-Application
machine	I-Application
.	O
</s>
<s>
In	O
practice	O
,	O
HotSpot	B-Language
entirely	O
eliminates	O
every	O
stack	B-Application
besides	O
the	O
native	O
thread/call	O
stack	B-Application
even	O
when	O
running	O
in	O
Interpreted	O
mode	O
,	O
as	O
its	O
Templating	O
Interpreter	B-Application
technically	O
functions	O
as	O
a	O
compiler	O
.	O
</s>
<s>
The	O
JVM	B-Language
has	O
instructions	O
for	O
the	O
following	O
groups	O
of	O
tasks	O
:	O
</s>
<s>
Each	O
particular	O
host	O
operating	B-General_Concept
system	I-General_Concept
needs	O
its	O
own	O
implementation	O
of	O
the	O
JVM	B-Language
and	O
runtime	O
.	O
</s>
<s>
These	O
JVMs	B-Language
interpret	O
the	O
bytecode	O
semantically	O
the	O
same	O
way	O
,	O
but	O
the	O
actual	O
implementation	O
may	O
be	O
different	O
.	O
</s>
<s>
More	O
complex	O
than	O
just	O
emulating	O
bytecode	O
is	O
compatibly	O
and	O
efficiently	O
implementing	O
the	O
Java	B-Library
core	I-Library
API	I-Library
that	O
must	O
be	O
mapped	O
to	O
each	O
host	O
operating	B-General_Concept
system	I-General_Concept
.	O
</s>
<s>
These	O
instructions	O
operate	O
on	O
a	O
set	O
of	O
common	O
rather	O
the	O
native	O
data	O
types	O
of	O
any	O
specific	O
instruction	B-General_Concept
set	I-General_Concept
architecture	I-General_Concept
.	O
</s>
<s>
A	O
JVM	B-Language
language	I-Language
is	O
any	O
language	O
with	O
functionality	O
that	O
can	O
be	O
expressed	O
in	O
terms	O
of	O
a	O
valid	O
class	B-Language
file	I-Language
which	O
can	O
be	O
hosted	O
by	O
the	O
Java	B-Language
Virtual	I-Language
Machine	I-Language
.	O
</s>
<s>
A	O
class	B-Language
file	I-Language
contains	O
Java	B-Language
Virtual	I-Language
Machine	I-Language
instructions	O
(	O
Java	B-Language
byte	I-Language
code	I-Language
)	O
and	O
a	O
symbol	O
table	O
,	O
as	O
well	O
as	O
other	O
ancillary	O
information	O
.	O
</s>
<s>
The	O
class	B-Language
file	I-Language
format	I-Language
is	O
the	O
hardware	O
-	O
and	O
operating	O
system-independent	O
binary	O
format	O
used	O
to	O
represent	O
compiled	O
classes	O
and	O
interfaces	O
.	O
</s>
<s>
There	O
are	O
several	O
JVM	B-Language
languages	I-Language
,	O
both	O
old	O
languages	O
ported	O
to	O
JVM	B-Language
and	O
completely	O
new	O
languages	O
.	O
</s>
<s>
JRuby	B-Language
and	O
Jython	B-Language
are	O
perhaps	O
the	O
most	O
well-known	O
ports	O
of	O
existing	O
languages	O
,	O
i.e.	O
</s>
<s>
Ruby	B-Language
and	O
Python	B-Language
respectively	O
.	O
</s>
<s>
Of	O
the	O
new	O
languages	O
that	O
have	O
been	O
created	O
from	O
scratch	O
to	O
compile	O
to	O
Java	B-Language
bytecode	I-Language
,	O
Clojure	B-Language
,	O
Groovy	B-Application
,	O
Scala	B-Application
and	O
Kotlin	B-Language
may	O
be	O
the	O
most	O
popular	O
ones	O
.	O
</s>
<s>
A	O
notable	O
feature	O
with	O
the	O
JVM	B-Language
languages	I-Language
is	O
that	O
they	O
are	O
compatible	B-Language
with	I-Language
each	I-Language
other	I-Language
,	O
so	O
that	O
,	O
for	O
example	O
,	O
Scala	B-Application
libraries	O
can	O
be	O
used	O
with	O
Java	B-Device
programs	O
and	O
vice	O
versa	O
.	O
</s>
<s>
Java	B-Device
7	O
JVM	B-Language
implements	O
JSR	B-Application
292	I-Application
:	O
Supporting	O
Dynamically	O
Typed	O
Languages	O
on	O
the	O
Java	B-Device
Platform	I-Device
,	O
a	O
new	O
feature	O
which	O
supports	O
dynamically	O
typed	O
languages	O
in	O
the	O
JVM	B-Language
.	O
</s>
<s>
This	O
feature	O
is	O
developed	O
within	O
the	O
Da	B-Application
Vinci	I-Application
Machine	I-Application
project	O
whose	O
mission	O
is	O
to	O
extend	O
the	O
JVM	B-Language
so	O
that	O
it	O
supports	O
languages	O
other	O
than	O
Java	B-Device
.	O
</s>
<s>
A	O
basic	O
philosophy	O
of	O
Java	B-Device
is	O
that	O
it	O
is	O
inherently	O
safe	O
from	O
the	O
standpoint	O
that	O
no	O
user	O
program	O
can	O
crash	O
the	O
host	O
machine	O
or	O
otherwise	O
interfere	O
inappropriately	O
with	O
other	O
operations	O
on	O
the	O
host	O
machine	O
,	O
and	O
that	O
it	O
is	O
possible	O
to	O
protect	O
certain	O
methods	O
and	O
data	O
structures	O
belonging	O
to	O
trusted	O
code	O
from	O
access	O
or	O
corruption	O
by	O
untrusted	O
code	O
executing	O
within	O
the	O
same	O
JVM	B-Language
.	O
</s>
<s>
Several	O
features	O
of	O
Java	B-Device
combine	O
to	O
provide	O
this	O
safety	O
,	O
including	O
the	O
class	O
model	O
,	O
the	O
garbage-collected	O
heap	O
,	O
and	O
the	O
verifier	O
.	O
</s>
<s>
The	O
JVM	B-Language
verifies	O
all	O
bytecode	O
before	O
it	O
is	O
executed	O
.	O
</s>
<s>
a	O
jump	O
(	O
branch	O
)	O
instruction	O
can	O
only	O
target	O
an	O
instruction	O
within	O
the	O
same	O
method	B-Language
.	O
</s>
<s>
Furthermore	O
,	O
the	O
verifier	O
ensures	O
that	O
any	O
given	O
instruction	O
operates	O
on	O
a	O
fixed	O
stack	B-Application
location	O
,	O
allowing	O
the	O
JIT	O
compiler	O
to	O
transform	O
stack	B-Application
accesses	O
into	O
fixed	O
register	O
accesses	O
.	O
</s>
<s>
Because	O
of	O
this	O
,	O
that	O
the	O
JVM	B-Language
is	O
a	O
stack	B-Application
architecture	I-Application
does	O
not	O
imply	O
a	O
speed	O
penalty	O
for	O
emulation	O
on	O
register-based	B-Application
architectures	I-Application
when	O
using	O
a	O
JIT	O
compiler	O
.	O
</s>
<s>
In	O
the	O
face	O
of	O
the	O
code-verified	O
JVM	B-Language
architecture	I-Language
,	O
it	O
makes	O
no	O
difference	O
to	O
a	O
JIT	O
compiler	O
whether	O
it	O
gets	O
named	O
imaginary	O
registers	B-General_Concept
or	O
imaginary	O
stack	B-Application
positions	O
that	O
must	O
be	O
allocated	O
to	O
the	O
target	O
architecture	O
's	O
registers	B-General_Concept
.	O
</s>
<s>
In	O
fact	O
,	O
code	O
verification	O
makes	O
the	O
JVM	B-Language
different	O
from	O
a	O
classic	O
stack	B-Application
architecture	I-Application
,	O
of	O
which	O
efficient	O
emulation	O
with	O
a	O
JIT	O
compiler	O
is	O
more	O
complicated	O
and	O
typically	O
carried	O
out	O
by	O
a	O
slower	O
interpreter	B-Application
.	O
</s>
<s>
Additionally	O
,	O
the	O
Interpreter	B-Application
used	O
by	O
the	O
default	O
JVM	B-Language
is	O
a	O
special	O
type	O
known	O
as	O
a	O
Template	O
Interpreter	B-Application
,	O
which	O
translates	O
bytecode	O
directly	O
to	O
native	O
,	O
register	O
based	O
machine	B-Language
language	I-Language
rather	O
than	O
emulate	O
a	O
stack	B-Application
like	O
a	O
typical	O
interpreter	B-Application
.	O
</s>
<s>
In	O
many	O
aspects	O
the	O
HotSpot	B-Language
Interpreter	B-Application
can	O
be	O
considered	O
a	O
JIT	O
compiler	O
rather	O
than	O
a	O
true	O
interpreter	B-Application
,	O
meaning	O
the	O
stack	B-Application
architecture	I-Application
that	O
the	O
bytecode	O
targets	O
is	O
not	O
actually	O
used	O
in	O
the	O
implementation	O
,	O
but	O
merely	O
a	O
specification	O
for	O
the	O
intermediate	O
representation	O
that	O
can	O
well	O
be	O
implemented	O
in	O
a	O
register	O
based	O
architecture	O
.	O
</s>
<s>
Another	O
instance	O
of	O
a	O
stack	B-Application
architecture	I-Application
being	O
merely	O
a	O
specification	O
and	O
implemented	O
in	O
a	O
register	O
based	O
virtual	B-Architecture
machine	I-Architecture
is	O
the	O
Common	O
Language	O
Runtime	O
.	O
</s>
<s>
A	O
number	O
of	O
attempts	O
have	O
been	O
made	O
to	O
specify	O
the	O
JVM	B-Language
as	O
a	O
formal	O
system	O
.	O
</s>
<s>
By	O
doing	O
this	O
,	O
the	O
security	O
of	O
current	O
JVM	B-Language
implementations	O
can	O
more	O
thoroughly	O
be	O
analyzed	O
,	O
and	O
potential	O
security	O
exploits	O
prevented	O
.	O
</s>
<s>
It	O
will	O
also	O
be	O
possible	O
to	O
optimize	O
the	O
JVM	B-Language
by	O
skipping	O
unnecessary	O
safety	O
checks	O
,	O
if	O
the	O
application	O
being	O
run	O
is	O
proven	O
to	O
be	O
safe	O
.	O
</s>
<s>
A	O
virtual	B-Architecture
machine	I-Architecture
architecture	O
allows	O
very	O
fine-grained	O
control	O
over	O
the	O
actions	O
that	O
code	O
within	O
the	O
machine	O
is	O
permitted	O
to	O
take	O
.	O
</s>
<s>
It	O
assumes	O
the	O
code	O
is	O
"	O
semantically	O
"	O
correct	O
,	O
that	O
is	O
,	O
it	O
successfully	O
passed	O
the	O
(	O
formal	O
)	O
bytecode	O
verifier	O
process	O
,	O
materialized	O
by	O
a	O
tool	O
,	O
possibly	O
off-board	O
the	O
virtual	B-Architecture
machine	I-Architecture
.	O
</s>
<s>
This	O
is	O
designed	O
to	O
allow	O
safe	O
execution	O
of	O
untrusted	O
code	O
from	O
remote	O
sources	O
,	O
a	O
model	O
used	O
by	O
Java	B-Application
applets	I-Application
,	O
and	O
other	O
secure	O
code	O
downloads	O
.	O
</s>
<s>
For	O
each	O
hardware	O
architecture	O
a	O
different	O
Java	B-Language
bytecode	I-Language
interpreter	B-Application
is	O
needed	O
.	O
</s>
<s>
When	O
a	O
computer	O
has	O
a	O
Java	B-Language
bytecode	I-Language
interpreter	B-Application
,	O
it	O
can	O
run	O
any	O
Java	B-Language
bytecode	I-Language
program	O
,	O
and	O
the	O
same	O
program	O
can	O
be	O
run	O
on	O
any	O
computer	O
that	O
has	O
such	O
an	O
interpreter	B-Application
.	O
</s>
<s>
When	O
Java	B-Language
bytecode	I-Language
is	O
executed	O
by	O
an	O
interpreter	B-Application
,	O
the	O
execution	O
will	O
always	O
be	O
slower	O
than	O
the	O
execution	O
of	O
the	O
same	O
program	O
compiled	O
into	O
native	O
machine	B-Language
language	I-Language
.	O
</s>
<s>
This	O
problem	O
is	O
mitigated	O
by	O
just-in-time	O
(	O
JIT	O
)	O
compilers	O
for	O
executing	O
Java	B-Language
bytecode	I-Language
.	O
</s>
<s>
A	O
JIT	O
compiler	O
may	O
translate	O
Java	B-Language
bytecode	I-Language
into	O
native	O
machine	B-Language
language	I-Language
while	O
executing	O
the	O
program	O
.	O
</s>
<s>
There	O
is	O
no	O
necessary	O
connection	O
between	O
the	O
Java	B-Device
programming	O
language	O
and	O
Java	B-Language
bytecode	I-Language
.	O
</s>
<s>
A	O
program	O
written	O
in	O
Java	B-Device
can	O
be	O
compiled	O
directly	O
into	O
the	O
machine	B-Language
language	I-Language
of	O
a	O
real	O
computer	O
and	O
programs	O
written	O
in	O
other	B-Language
languages	I-Language
than	O
Java	B-Device
can	O
be	O
compiled	O
into	O
Java	B-Language
bytecode	I-Language
.	O
</s>
<s>
Java	B-Language
bytecode	I-Language
is	O
intended	O
to	O
be	O
platform-independent	O
and	O
secure	O
.	O
</s>
<s>
Some	O
JVM	B-Language
implementations	O
do	O
not	O
include	O
an	O
interpreter	B-Application
,	O
but	O
consist	O
only	O
of	O
a	O
just-in-time	O
compiler	O
.	O
</s>
<s>
At	O
the	O
start	O
of	O
the	O
Java	B-Device
platform	I-Device
's	O
lifetime	O
,	O
the	O
JVM	B-Language
was	O
marketed	O
as	O
a	O
web	O
technology	O
for	O
creating	O
Rich	B-Application
Web	I-Application
Applications	I-Application
.	O
</s>
<s>
,	O
most	O
web	O
browsers	O
and	O
operating	B-General_Concept
systems	I-General_Concept
bundling	O
web	O
browsers	O
do	O
not	O
ship	O
with	O
a	O
Java	B-Application
plug-in	I-Application
,	O
nor	O
do	O
they	O
permit	O
side-loading	O
any	O
non-Flash	O
plug-in	B-Application
.	O
</s>
<s>
The	O
Java	B-Device
browser	O
plugin	B-Application
was	O
deprecated	O
in	O
JDK	B-Language
9	O
.	O
</s>
<s>
The	O
NPAPI	B-Protocol
Java	B-Device
browser	O
plug-in	B-Application
was	O
designed	O
to	O
allow	O
the	O
JVM	B-Language
to	O
execute	O
so-called	O
Java	B-Application
applets	I-Application
embedded	O
into	O
HTML	O
pages	O
.	O
</s>
<s>
For	O
browsers	O
with	O
the	O
plug-in	B-Application
installed	O
,	O
the	O
applet	O
is	O
allowed	O
to	O
draw	O
into	O
a	O
rectangular	O
region	O
on	O
the	O
page	O
assigned	O
to	O
it	O
.	O
</s>
<s>
Because	O
the	O
plug-in	B-Application
includes	O
a	O
JVM	B-Language
,	O
Java	B-Application
applets	I-Application
are	O
not	O
restricted	O
to	O
the	O
Java	B-Device
programming	O
language	O
;	O
any	O
language	O
targeting	O
the	O
JVM	B-Language
may	O
run	O
in	O
the	O
plug-in	B-Application
.	O
</s>
<s>
Adobe	B-Operating_System
Flash	I-Operating_System
Player	I-Operating_System
,	O
the	O
main	O
competing	O
technology	O
,	O
works	O
in	O
the	O
same	O
way	O
in	O
this	O
respect	O
.	O
</s>
<s>
according	O
to	O
W3Techs	O
,	O
Java	B-Application
applet	I-Application
and	O
Silverlight	B-Application
use	O
had	O
fallen	O
to	O
0.1	O
%	O
each	O
for	O
all	O
web	O
sites	O
,	O
while	O
Flash	B-Operating_System
had	O
fallen	O
to	O
10.8	O
%	O
.	O
</s>
<s>
As	O
of	O
May	O
2016	O
,	O
JavaPoly	O
allows	O
users	O
to	O
import	O
unmodified	O
Java	B-Device
libraries	O
,	O
and	O
invoke	O
them	O
directly	O
from	O
JavaScript	O
.	O
</s>
<s>
JavaPoly	O
allows	O
websites	O
to	O
use	O
unmodified	O
Java	B-Device
libraries	O
,	O
even	O
if	O
the	O
user	O
does	O
not	O
have	O
Java	B-Device
installed	O
on	O
their	O
computer	O
.	O
</s>
<s>
With	O
the	O
continuing	O
improvements	O
in	O
JavaScript	O
execution	O
speed	O
,	O
combined	O
with	O
the	O
increased	O
use	O
of	O
mobile	O
devices	O
whose	O
web	O
browsers	O
do	O
not	O
implement	O
support	O
for	O
plugins	B-Application
,	O
there	O
are	O
efforts	O
to	O
target	O
those	O
users	O
through	O
compilation	O
to	O
JavaScript	O
.	O
</s>
<s>
It	O
is	O
possible	O
to	O
either	O
compile	O
the	O
source	O
code	O
or	O
JVM	B-Language
bytecode	I-Language
to	O
JavaScript	O
.	O
</s>
<s>
Compiling	O
the	O
JVM	B-Language
bytecode	I-Language
,	O
which	O
is	O
universal	O
across	O
JVM	B-Language
languages	I-Language
,	O
allows	O
building	O
upon	O
the	O
language	O
's	O
existing	O
compiler	O
to	O
bytecode	O
.	O
</s>
<s>
The	O
main	O
JVM	B-Language
bytecode	I-Language
to	O
JavaScript	O
compilers	O
are	O
TeaVM	O
,	O
the	O
compiler	O
contained	O
in	O
Dragome	O
Web	O
SDK	O
,	O
Bck2Brwsr	O
,	O
and	O
j2js-compiler	O
.	O
</s>
<s>
Leading	O
compilers	O
from	O
JVM	B-Language
languages	I-Language
to	O
JavaScript	O
include	O
the	O
Java-to-JavaScript	O
compiler	O
contained	O
in	O
Google	B-Language
Web	I-Language
Toolkit	I-Language
,	O
Clojurescript	B-Language
(	O
Clojure	B-Language
)	O
,	O
GrooScript	O
(	O
Apache	B-Application
Groovy	I-Application
)	O
,	O
Scala.js	B-Application
(	O
Scala	B-Application
)	O
and	O
others	O
.	O
</s>
