aspose file tools*
The moose likes Java in General and the fly likes How does a JVM convert a java File into a Class File? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How does a JVM convert a java File into a Class File?" Watch "How does a JVM convert a java File into a Class File?" New topic
Author

How does a JVM convert a java File into a Class File?

karthik Suryanarayanan
Ranch Hand

Joined: Oct 07, 2009
Posts: 117

Hello,
Could anyone help me how a JVM converts a java file into a Class file. What are the Types of Values it uses. Does those values will be declared in the class. Is there any Specific Format? Thank you So much..[/size]


"Learning is a Culture where your Eagerness & Curiosity plays a major Role".
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39885
    
  28
It doesn't convert a .java file to a .class file. That is done by the "compiler", javac. You can see the format of a .class file like this
javac MyFile.java
javap -c MyFile
It is much easier if MyFile is a very small file. You can find how to convert to a .class file from any standard compiler book.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

http://en.wikipedia.org/wiki/Class_(file_format)
http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html
karthik Suryanarayanan
Ranch Hand

Joined: Oct 07, 2009
Posts: 117

Thank you very much Campbell & David. I went through the materials & will i have joined a long ago to this site but couldn't continue. Now onwards i hope i'll be here definitely with as much help and support from you guys & hope to do the Same to others. Once again thank you very much Ranchers.I am going to write my SCJP. Want inputs from you whether i could start from 1.5 or directly 1.6. Guide me with the specific topics so i could be more practised. And also some reference Materials.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14352
    
  22

karthik Suryanarayanan wrote:I am going to write my SCJP. Want inputs from you whether i could start from 1.5 or directly 1.6. Guide me with the specific topics so i could be more practised. And also some reference Materials.

Do SCJP 6, it makes no sense to do the SCJP for Java 5 (because it's an older version).

For more information, see our SCJP FAQ. We also have an SCJP forum where you can ask all your questions related to the SCJP.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
Don't get me started about those stupid light bulbs.
 
subject: How does a JVM convert a java File into a Class File?