Javatpoint Logo

can we execute our .class file in our machine without install jdk

By: rsbalh*** On: Sun Aug 18 14:14:40 EDT 2013     Question Reputation0 Answer Reputation0 Quiz Belt Series Points0  0Blank User
can we execute our .class file in our machine without install jdk ??????

what is jre ?? i know it is java run time environment but jvm translate .class into machine code but what is the work of JRE ??? if our java program run with the help of jre then why should we need of jvm ???? otherwise what is need of jre ???? plzz update me asap.
Up0Down

 


JRE: Java Runtime Environment. It is basically the Java Virtual Machine where your Java programs run on. It also includes browser plugins for Applet execution.

JDK: It's the full featured Software Development Kit for Java, including JRE, and the compilers and tools (like JavaDoc, and Java Debugger) to create and compile programs.

jvm.A Java virtual machine (JVM) is a virtual machine that can execute Java bytecode. It is the code execution component of the Java platform.

Using an interpreter, all Java programs are compiled to an intermediate level called byte code. We can run the compiled byte code on any computer with the Java runtime environment installed on it. The runtime environment consists of a virtual machine and its supporting code.


Usually, when you only care about running Java programs on your browser or computer you will only install JRE. It's all you need. On the other hand, if you are planning to do some Java programming, you will also need JDK.

Sometimes, even though you are not planning to do any Java Development on a computer, you still need the JDK installed. For example, if you are deploying a WebApp with JSP, you are technically just running Java Programs inside the application server. Why would you need JDK then? Because application server will convert JSP into Servlets and use JDK to compile the servlets. I am sure there might be more examples.
Image Created1Down

By: [email protected] On: Mon Aug 19 02:22:03 EDT 2013 Question Reputation0 Answer Reputation392 Belt Series Points0 392User Image
Are You Satisfied :5Yes2No
 
you need to use a JIT (Just In Time) compiler to do it.
JIT compilers attach the JRE with you executable file, so you don't need
to affraid about it. But, please keep in mind that using that tool your
Java program will only run under the target plataform ( e.g, you compile
the java program under windows.. it never will run under linux, for
example ).
Image Created0Down

By: [email protected] On: Mon Aug 19 07:00:35 EDT 2013 Question Reputation0 Answer Reputation153 Belt Series Points0 153User Image
Are You Satisfied :3Yes0No