Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
ram - 26 Aug 2007 06:18 GMT
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
ameyas7 - 26 Aug 2007 07:01 GMT
> hi there ,
>    in course of writing a program i needed to input "java source code"
[quoted text clipped - 3 lines]
>    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 - 26 Aug 2007 07:02 GMT
> hi there ,
>    in course of writing a program i needed to input "java source code"
[quoted text clipped - 3 lines]
>    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.
Andrew Thompson - 26 Aug 2007 07:09 GMT
>...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.

Signature

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

Roedy Green - 26 Aug 2007 10:49 GMT
>hi there ,
>   in course of writing a program i needed to input "java source code"
[quoted text clipped - 3 lines]
>   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
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Lew - 26 Aug 2007 14:17 GMT
>> hi there ,
>>   in course of writing a program i needed to input "java source code"
[quoted text clipped - 6 lines]
> 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>

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.