|
-
Dec 5th, 2001, 01:17 PM
#1
Thread Starter
Fanatic Member
what is the purpose of the .class file [resolved]
i was just wondering when you compile your program you have a .class file, but when you goto run your program you are running the .java file, so what pupose does the .class file have ???
there must be some point though yeah ??
Last edited by zmerlinz; Dec 7th, 2001 at 10:33 AM.
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Dec 5th, 2001, 01:30 PM
#2
Actually, you are not running the .java file, you are running the .class file. The .java file is just the ASCII text source code. The .class file is the compiled code, like a .exe file.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Dec 5th, 2001, 02:36 PM
#3
Thread Starter
Fanatic Member
but surely it is the java file that you are running because to run it you type
java Something.java
and not
java Something.class
and there isn't any ascii code in the class file, well none that i saw ??
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Dec 5th, 2001, 02:44 PM
#4
Lively Member
All you type is java Something not java Something.java. If you are using JDK that is. With JDK you compile with javac Something.java then to run you use java Something
Don't ever Ginop before you Ginip 
-
Dec 5th, 2001, 02:53 PM
#5
Thread Starter
Fanatic Member
oh yeah i forgot about that thanks, i am new to java btw 
but still i can't see a use for the .class file
can you actualy compile a java program to an exe at all ??
if so how ?
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Dec 5th, 2001, 02:56 PM
#6
Lively Member
I'm new to it also. I believe you need a 3rd party software to convert to exe. Unless Borland has something built into Jbuilder.
Don't ever Ginop before you Ginip 
-
Dec 5th, 2001, 03:12 PM
#7
Yes there are apps to convert class files to exe's. I started a thread about that a while ago, I'll see if I can find it.
The reason that java files are compiled into class and not exe files, is because exe format is OS-dependant, and that would undermine the whole purpose behind Java's platform independence.
When you type in "java Something" the JVM kicks off and runs the class file. The JVM interprets the class file's code, and translates it to a form that the OS understands.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Dec 5th, 2001, 03:14 PM
#8
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Dec 5th, 2001, 07:18 PM
#9
PowerPoster
Yeah, the class file is the byte code. It is then run by the VM.
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
-
Dec 5th, 2001, 09:18 PM
#10
Thread Starter
Fanatic Member
ok then cheers guys
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|