Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Compile java files programmatically

Reply
Thread Tools

Compile java files programmatically

 
 
Roedy Green
Guest
Posts: n/a
 
      05-22-2004
On Sat, 22 May 2004 03:22:06 GMT, Neal Gafter
<search-for-me-on-> wrote or quoted :

>As you can see by following the link that you posted, I am the spec lead for
>jsr199. I am also the lead engineer for javac at Sun. It is because jsr199
>will not be included in 1.5 that we're documenting these methods for JDK 1.5,
>thereby committing to their continued existence for a long time.


What problems do you have to solve in that?

1. providing for fishing source from files on disk or from files
generated in ram,

2. dealing with a mixture of encodings.

3. conditional compilation -- exactly when can you avoid
recompilation?

4. where to put the class files.

5. changing class files that are already running.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
 
 
 
Neal Gafter
Guest
Posts: n/a
 
      05-22-2004
Roedy Green wrote:
> On Sat, 22 May 2004 03:22:06 GMT, Neal Gafter
> <search-for-me-on-> wrote or quoted :
>
>
>>As you can see by following the link that you posted, I am the spec lead for
>>jsr199. I am also the lead engineer for javac at Sun. It is because jsr199
>>will not be included in 1.5 that we're documenting these methods for JDK 1.5,
>>thereby committing to their continued existence for a long time.

>
>
> What problems do you have to solve in that?
>
> 1. providing for fishing source from files on disk or from files
> generated in ram,
>
> 2. dealing with a mixture of encodings.
>
> 3. conditional compilation -- exactly when can you avoid
> recompilation?
>
> 4. where to put the class files.
>
> 5. changing class files that are already running.
>


The com.sun.tools.javac API provides no more than you can do using the
command-line interface. Its only advantage is that it runs in the same Java VM
that invokes it.

Issues (1), (2), and (4) will be addressed by jsr199's use of an abstract
filesystem API that you can use to specify source, class, and distination paths.

For issue (3) I suggest you see
<http://www.experimentalstuff.com/Technologies/JavaMake/>. Doing the dependence
analysis "properly" requires that it all be done before compilation begins,
which is part of the reason javac doesn't do this now.

Issue (5) is a VM issue, not a compilation issue, though I know there are a few
things happening in this area.

One thing you didn't mention is the ability to compile against the currently
loaded classes, rather than going to the disk for the class files. I'm working
on that too. That should speed up JSPs considerably.

 
Reply With Quote
 
 
 
 
bigbinc
Guest
Posts: n/a
 
      05-22-2004
Neal Gafter <search-for-me-on-> wrote in message news:<>...
> Michael Borgwardt wrote:
> > Quite the opposite. These methods are an undocumented internal
> > implementation
> > detail of Sun's SDK! They could disappear at *any* time without prior
> > notice!
> >
> > That's why there's an official compiler API being planned:
> > http://www.jcp.org/en/jsr/detail?id=199

>
> As you can see by following the link that you posted, I am the spec lead for
> jsr199. I am also the lead engineer for javac at Sun. It is because jsr199
> will not be included in 1.5 that we're documenting these methods for JDK 1.5,
> thereby committing to their continued existence for a long time.


Also join #java on irc.freenode.net, you too Roedy Green.
 
Reply With Quote
 
Scott Ellsworth
Guest
Posts: n/a
 
      05-23-2004
In article <AeKdnb1iV_pJMDPdRVn->,
Berlin Brown <> wrote:

> Sudsy wrote:
>
> > bigbinc wrote:
> > <snip>
> >> I am seeing more developers that work for 'Sun', 'IBM' speaking out in
> >> different forums, and we all know about the JBOSS fiasco, good to see
> >> you guys.

> >
> > Would you be so kind as to inform those of us "great unwashed" what
> > you mean by "the JBOSS fiasco"?
> > While I admit to not being a big fan of JBoss due to their attempts
> > at generating income, I'm unfamiliar with your claim.
> > Clarification would be most appreciated.

>
> Keep up, they have been talking about it on slashdot for weeks now.


Gotta admit - I routinely discount anonymous cowards on most fora, thus
this "fiasco" is no more than any other momentary flurry.

As far as using slashdot to keep up, I prefer primary sources.
Aggregators like slashdot can be kinda fun, but not all that important
over the long haul.

Scott
 
Reply With Quote
 
Bryce
Guest
Posts: n/a
 
      05-24-2004
On Fri, 21 May 2004 21:53:02 -0400, Sudsy <>
wrote:

>Berlin Brown wrote:
><snip>
>> Keep up, they have been talking about it on slashdot for weeks now.

>
>Thanks for the link! Actually, I DO keep up, and posted about how my
>submission to their tightly-controlled forum was quashed after just
>a few days. My concerns seem to be echoed by others, another fact I
>noted.
>Doesn't "Professional Open Source" sound a bit odd? I'm hardly
>averse to people earning a decent living from their efforts, BTW.
>I just don't like the idea of individuals or organizations purporting
>their products to be "free" when they're not.


How is JBoss not "free"?

--
now with more cowbell
 
Reply With Quote
 
akg akg is offline
Junior Member
Join Date: Apr 2012
Posts: 1
 
      04-18-2012
Hi can some one please send me() code to compile a java file programmaticially and report any compilation error.

I have tried javaruntime and was able to compile java file but was not able to capture compilation erro.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
compile directive for conditional compile for Java 1.4 versus Java 5 timjowers Java 7 02-02-2011 12:08 AM
How to compile the following source code in VC6// I have error inVC++6 but compile ok in GCC fAnSKyer C++ 2 06-07-2009 07:57 AM
computation at compile time i.e. compile time functions usingtemplates Carter C++ 2 03-04-2009 06:43 PM
Compile versus not compile (VS 2005)?? stupid48@gmail.com ASP .Net 1 04-11-2008 08:24 PM
cant compile on linux system.cant compile on cant compile onlinux system. Nagaraj C++ 1 03-01-2007 11:18 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57