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
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply 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: 675

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: 56157
    
  13

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 675

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: 56157
    
  13

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: 675

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: 56157
    
  13

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
Bartender

Joined: Aug 16, 2005
Posts: 12907
    
    3

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
 
I agree. Here's the link: http://jrebel.com/download
 
subject: do we need jre to run java programs ?
 
Similar Threads
Difference between JRE and JVM
JVM requirement on local machine
executable without any JDK???
jdk v/s jre
Difference between JVM and JRE