how can we invoke tools { like javac , javap} in java program ?

Discussion in 'Java' started by ram, Aug 26, 2007.

  1. ram

    ram Guest

    hi there ,
    in course of writing a program i needed to input "java source code"
    and compile it
    in program itself and pipe the compiled "class file" to other tool
    called "javap".
    so, anybody out there tell me how to invoke "javac & javap " from
    source itself
    ram, Aug 26, 2007
    #1
    1. Advertising

  2. ram

    ameyas7 Guest

    On Aug 26, 10:18 am, ram <> wrote:
    > hi there ,
    > in course of writing a program i needed to input "java source code"
    > and compile it
    > in program itself and pipe the compiled "class file" to other tool
    > called "javap".
    > so, anybody out there tell me how to invoke "javac & javap " from
    > source itself



    check out exec method of java.lang.Runtime class.

    regards
    amey
    ameyas7, Aug 26, 2007
    #2
    1. Advertising

  3. ram

    ameyas7 Guest

    On Aug 26, 10:18 am, ram <> wrote:
    > hi there ,
    > in course of writing a program i needed to input "java source code"
    > and compile it
    > in program itself and pipe the compiled "class file" to other tool
    > called "javap".
    > so, anybody out there tell me how to invoke "javac & javap " from
    > source itself


    oh i forgot to mention @ pipes.
    u may need to have a look at Process class as well.
    ameyas7, Aug 26, 2007
    #3
  4. ram wrote:
    >...i needed to input "java source code"
    >and compile it

    ...

    <http://mindprod.com/jgloss/javacmain.html>
    <http://www.google.com/search?q=jsr+199>

    ...
    > so, anybody out there tell me how to invoke "javac & javap " from
    >source itself


    Is that a question? If so, it pays to add a question mark (?).
    Another thing that encourages people to read messages,
    by making it easier for them to do that, is to use the Shift
    Key once at the start of each sentence.

    --
    Andrew Thompson
    http://www.athompson.info/andrew/

    Message posted via JavaKB.com
    http://www.javakb.com/Uwe/Forums.aspx/java-general/200708/1
    Andrew Thompson, Aug 26, 2007
    #4
  5. ram

    Roedy Green Guest

    On Sat, 25 Aug 2007 22:18:55 -0700, ram <>
    wrote, quoted or indirectly quoted someone who said :

    >hi there ,
    > in course of writing a program i needed to input "java source code"
    >and compile it
    >in program itself and pipe the compiled "class file" to other tool
    >called "javap".
    > so, anybody out there tell me how to invoke "javac & javap " from
    >source itself


    see http://mindprod.com/jgloss/onthefly.html for javac
    http://mindprod.com/jgloss/exec.html for javap
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, Aug 26, 2007
    #5
  6. ram

    Lew Guest

    Re: how can we invoke tools { like javac , javap} in java program?

    Roedy Green wrote:
    > On Sat, 25 Aug 2007 22:18:55 -0700, ram <>
    > wrote, quoted or indirectly quoted someone who said :
    >
    >> hi there ,
    >> in course of writing a program i needed to input "java source code"
    >> and compile it
    >> in program itself and pipe the compiled "class file" to other tool
    >> called "javap".
    >> so, anybody out there tell me how to invoke "javac & javap " from
    >> source itself

    >
    > see http://mindprod.com/jgloss/onthefly.html for javac
    > http://mindprod.com/jgloss/exec.html for javap


    The Java Compiler API:
    <http://jcp.org/en/jsr/detail?id=199>
    <http://java.sun.com/javase/6/docs/api/javax/tools/package-summary.html>
    <http://java.sun.com/javase/6/docs/api/javax/tools/JavaCompiler.html>

    --
    Lew
    Lew, Aug 26, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stefan
    Replies:
    0
    Views:
    4,980
    Stefan
    Nov 5, 2003
  2. Chandresh Prakash
    Replies:
    1
    Views:
    1,905
    Jeffrey Palm
    Dec 5, 2003
  3. Deshaies
    Replies:
    8
    Views:
    478
    Roedy Green
    Apr 26, 2004
  4. TenderHeart

    java assembler?? for Javap utility??

    TenderHeart, Apr 29, 2005, in forum: Java
    Replies:
    1
    Views:
    662
    =?ISO-8859-1?Q?Daniel_Sj=F6blom?=
    Apr 29, 2005
  5. Replies:
    1
    Views:
    499
    Andrew Thompson
    Oct 31, 2005
Loading...

Share This Page