The Artima Developer Community
Sponsored Link

Java Answers Forum
I neeed help on java compiler

2 replies on 1 page. Most recent reply: Apr 24, 2005 10:39 AM by Malinda

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Malinda

Posts: 4
Nickname: malinda
Registered: Feb, 2005

I neeed help on java compiler Posted: Feb 2, 2005 8:52 AM
Reply to this message Reply
Advertisement
i seriously need help on java compiler the phases of the compiler and hw does it deliver the Byte code and the link to the JVM. if theres any online articles,links i should visit please advise me!!

my mail: malinda.fernando@gmail.com


Pradeep

Posts: 3
Nickname: pradeepa
Registered: Jan, 2005

Re: I neeed help on java compiler Posted: Feb 4, 2005 1:57 AM
Reply to this message Reply
Hi Malinda ,

Use the javac - verbose option for a simple java file . and you can observe what javac complier will do will compling the java class file. for detail documentation go for doc.sun.com

Pradeep.J

Malinda

Posts: 4
Nickname: malinda
Registered: Feb, 2005

I neeed help on javap option (Execution) Posted: Apr 24, 2005 10:39 AM
Reply to this message Reply
when a small program like

class Hello{

public static void main(String arg[])

{

System.out.println("HEllo World");

}

}

was compiled and then the i took the java byte code instruction
through JAVAP option(disassembler)
the byte code instructions for the above program was

Compiled from "Hello.java"
class Hello extends java.lang.Object{
Hello();
Code:
0: aload_0
1: invokespecial #1; //Method java/lang/Object."<init>":()V
4: return

public static void main(java.lang.String[]);
Code:
0: getstatic #2; //Field java/lang/System.out:Ljava/io/PrintStream;
3: ldc #3; //String HEllo World
5: invokevirtual #4; //Method java/io/PrintStream.println:(Ljava/lang/Str
ing;)V
8: return

}
without giving the program "Hello.java"
to the JVM how can i run the "Hello" program through JVM by giving the
above byte code instructions "which was gained by using the javap
option" to the JVM??

basicaly I want to get the output of "Hello World" by giving the below
byte code instructions to the JVM

Compiled from "Hello.java"
class Hello extends java.lang.Object{
Hello();
Code:
0: aload_0
1: invokespecial #1; //Method java/lang/Object."<init>":()V
4: return

public static void main(java.lang.String[]);
Code:
0: getstatic #2; //Field java/lang/System.out:Ljava/io/PrintStream;
3: ldc #3; //String HEllo World
5: invokevirtual #4; //Method java/io/PrintStream.println:(Ljava/lang/Str
ing;)V
8: return

}

please send me the way that i should execute it through JVM!!!!

Thank you

- Malinda

Flat View: This topic has 2 replies on 1 page
Topic: adding text fields Previous Topic   Next Topic Topic: PDA Programming using J2ME

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use