About JVM(Java virtua machine).

Can anyone pls explain me what is JVM(Java virtual machine)? What are JSR and their significance?

Replies

  • Morningdot Hablu
    Morningdot Hablu
    Hello vijay,
    I think you must know about c++ execution file that is ".exe".
    Our window operating system designed in such a way that it support ".exe" file.
    .
    Now move to java, java create a ".class" file that is not supported by your window operating system.
    To understand this just paste a ".class" file on Desktop of the system in which jvm is not installed.
    You must find that the unsupported file icon is appierd on your file.
    Now installed a jvm and then look you must found a cup like icon on your file.
    .
    Actually jvm working is same as that of operating system in c++.
    In the case of c++ it's an operating system work to read a ".exe" file.
    But in case of java that platform is provided by your jvm.
    .
    .......One more thing i must add that java does not create any ".exe" file java creates a .class file that is supported by your java virtual machine and you must have to interprete them in oredr to run them on any machine that is why java is also called an interpreted language.

    ;-);-);-)
  • sushant005
    sushant005
    When you compile a java program then it checks the syntax and semantics and a .class file is prepared where your java file is saved now the role of JVM comes into play. JVM is a interpreter which interpret the .class file(bytecode) and provide its executable file.
    JVM is responsible for the java portability and make it platform independent reason is that you only need JVM is to be implemented for each platform.

    The trouble/limitation with the c or c++ programming was that it is designed to be compiled for a specific target and not platform independent means that suppose you have to one system with Windows OS and intel processor and another system is with unix OS and AMD processor so it is very tedious task to make compiler for different platform then the concept of java is introduced and in which JVM makes the java completely platform independent.This is the primary aim for the development of the java programming language.Later on, most of the users stick to the windows OS then its and important features takes place i.e its web application.

    JVM has the three major component:
    1>class loader:- it is used to load the class file, which are required by the program running on the memory.The class file is loaded dynamically when required.

    2>Execution Engine:-It is used to run the Bytecode(.class file) line after another.IT converts the bytecode to the machine object code nad run it.

    3>JIT compiler:-This concept is released with the Java 2(version 1.2) .It compiles the bytecode into executable code.
  • vijaymp
    vijaymp
    Thanks a lot sushant and Mohit for ur information. Can u just explain me about JSRs? U can even share some web links or material related to that.
  • Morningdot Hablu
    Morningdot Hablu
    oh!!
    Sorry i didn't notice your second question...actually JSR stands for Java Specification Request... as you can understand from the name ,, it is a formal way to request changes in the languages or the technology in general. However you need to have a JSPA
    agreement for your requests to be noticed/ read...this is charegeable.
  • vijaymp
    vijaymp
    I thin I need more info abt it.. Can u guide me some web links where I can get more info abt it? I am doing testing on mobiles. I need to know which JSRs will support what features.,
  • anandkumarjha
    anandkumarjha
    Rightly said by mohit and sushant but i would like to add more to it
    JVM can also be use to implement programming language other than java. For example, Ada source code can be compiled to Java bytecode, which may then be executed by a JVM
    Programs intended to run on a JVM must be compiled into a standardized portable binary format, which typically comes in the form of .class files. A program may consist of many classes in different files. For easier distribution of large programs, multiple class files may be packaged together in a .jar file (short for Java archive).
    The JVM runtime executes .class or .jar files,
  • HImanshu_Sharma
    HImanshu_Sharma
    one more thing engineers...
    jvm is plateform dependent. it can be executed only on windows os because its setup file is .exe type..then how can we use java on linux operating system?
    because linux doesn't hav .exe as its setup?
  • anandkumarjha
    anandkumarjha
    Himanshu !!!!
    as far as i know JVM(java virtual machine)is not platform dependent rather its platform independent. it can have its effect on linux as well

    if i am wrong then please let me know
  • Morningdot Hablu
    Morningdot Hablu
    anandkumarjha
    Himanshu !!!!
    as far as i know JVM(java virtual machine)is not platform dependent rather its platform independent. it can have its effect on linux as well

    if i am wrong then please let me know
    No no anand jvm is not plateform independent ......jvm provide such like a plateform that makes java plateform independent.
    ......so java is plateform independent ...not jvm.
    ;-);-);-)
  • anandkumarjha
    anandkumarjha
    Thank you mohit for correcting me but then i have one doubt in my mind that as asked by himanshu how can jvm work on linux as linux does not support .exe file extension?
  • sushant005
    sushant005
    HImanshu_Sharma
    one more thing engineers...
    jvm is plateform dependent. it can be executed only on windows os because its setup file is .exe type..then how can we use java on linux operating system?
    because linux doesn't hav .exe as its setup?
    Hi Himanshu!
    What you have said that JVM is platform dependent its not true JVM cannot be platform dependent it is the only concept which makes the java platform independent.......for more details please read my previous post...........
  • sushant005
    sushant005
    anandkumarjha
    Thank you mohit for correcting me but then i have one doubt in my mind that as asked by himanshu how can jvm work on linux as linux does not support .exe file extension?
    hi anand, let me explain you,
    first JVM is an interpreter which executes the .class file and when we compile our java program it will first make a .class file which is not our final executable file.It shows that .class is portable all we just need an interpreter(JVM) in our system or in any other system which is used to interpret that .class file and produce the final result..
    Again all we need that we must have JVM installed in our system whether it is winOS or UNIX OS....
    i think you all haven't read my previous post carefully....please read it and then if you have any doubt then ask.........
  • HImanshu_Sharma
    HImanshu_Sharma
    sushant005
    Hi Himanshu!
    What you have said that JVM is platform dependent its not true JVM cannot be platform dependent it is the only concept which makes the java platform independent.......for more details please read my previous post...........
    then we can run it on linux operating system?
    its execution file is .exe and linux operating system doesn't have .exe extension,so how it is possible?
  • sushant005
    sushant005
    HImanshu_Sharma
    then we can run it on linux operating system?
    its execution file is .exe and linux operating system doesn't have .exe extension,so how it is possible?
    Sure you can run in Linux environment.
    You need to have JDK(Java Development Kit) installed in your system.Write program and save it and run...it will work fine...
    .exe file executable file supported by windows OS and .exe is not supported by linux OS that is one of the reason why JVM is introduced. All you need to have JDK installed in the system where you want to run your java program whether it is Unix OS,Windows OS or Mac OS,or any other...
    Again i am explaining you Java program is compiled to give the .class file which is a portable file, i mean to say you can run that .class file in any OS but you must have JVM installed on that system.And now the task of JVM is that it will run .class file and provides us the required output.

    Any doubt feel free to ask...
  • HImanshu_Sharma
    HImanshu_Sharma
    sushant005
    Sure you can run in Linux environment.
    You need to have JDK(Java Development Kit) installed in your system.Write program and save it and run...it will work fine...
    .exe file executable file supported by windows OS and .exe is not supported by linux OS that is one of the reason why JVM is introduced. All you need to have JDK installed in the system where you want to run your java program whether it is Unix OS,Windows OS or Mac OS,or any other...
    Again i am explaining you Java program is compiled to give the .class file which is a portable file, i mean to say you can run that .class file in any OS but you must have JVM installed on that system.And now the task of JVM is that it will run .class file and provides us the required output.

    Any doubt feel free to ask...
    ok shushank i know it is portable

You are reading an archived discussion.

Related Posts

I'm sure lot of Computer Science enthusiasts and mobile application developers will find the following information useful - Four part introduction to Samsung BADA OS - Part 1: https://media.wiley.com/assets/2249/08/introduction_to_bada_part_1.pdf Part...
hello friends.. i m i last year.. i need some latest seminar topics in instrumentation engineering.. can u plzzz suggest any topic....
Is this college a good one? Is any one aware about it?
Hello friend's, Generally most of engineers like late night study.I hear somewhere that engineers are learner in day and rocker in night. I like to study anytime.But didn't find time...
One of the most difficult unsolved mathematical problem in Computer Science has been cracked [or at least, Mr. Vinay Deolikar of HP Research Arm claims so]. Wikipedia Quotes - In...