aspose file tools*
The moose likes Java in General and the fly likes do we need jre to run java programs ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "do we need jre to run java programs ?" Watch "do we need jre to run java programs ?" New topic
Author

do we need jre to run java programs ?

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

do we need jre to run a java program or not ?
if yes please explain why we need it ?

The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61224
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

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

Joined: Jan 10, 2002
Posts: 61224
    
  66

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

Joined: Jul 03, 2011
Posts: 692

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

Joined: Jan 10, 2002
Posts: 61224
    
  66

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

Joined: Aug 16, 2005
Posts: 14153
    
  18

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.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
 
subject: do we need jre to run java programs ?