• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

do we need jre to run java programs ?

 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do we need jre to run a java program or not ?
if yes please explain why we need it ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JRE stands for Java Runtime Environment. It consists of a number of components including the JVM. The JVM is responsible for running Java byte-code so without it, a class file is just a useless file of bytes.
 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:JRE stands for Java Runtime Environment. It consists of a number of components including the JVM. The JVM is responsible for running Java byte-code so without it, a class file is just a useless file of bytes.

hi thanks for the reply that means my teacher was wrong she said we dont need jre to run java programs ....
and 1 more thing ...can we write kernal for os in java
like in c we can write but can we in java ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi thanks for the reply that means my teacher was wrong she said we dont need jre to run java programs ....

Yes, a JRE is required.

and 1 more thing

"one", not 1.

...can we write kernal for os in java
like in c we can write but can we in java ?

No. What would the JRE execute on?
 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
hi thanks for the reply that means my teacher was wrong she said we dont need jre to run java programs ....

Yes, a JRE is required.

and 1 more thing

"one", not 1.

...can we write kernal for os in java
like in c we can write but can we in java ?

No. What would the JRE execute on?

if you are asking me , i didnt get your point can you elaborate please
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The point is that a JRE is needed to run Java. So it cannot be realistically used to write an OS kernel.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15356
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There have been some processors in the past (I think one of them was named PicoJava) which could run Java bytecode natively. When you'd have that, you would not need a software JVM to run Java - the processor would run the bytecode directly. However, that never became a big success. There have also been attempts to write an operating system in Java. These had to have some part in native code for the JRE, so it's not pure Java.

But the point is that Java was never meant to be a low-level systems programming language, so even though you could write an OS in mostly pure Java, it would probably not be a really good idea.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic