Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Compiling a single java source file
Compiling a single java source file [message #111597] Wed, 29 October 2003 01:12 Go to next message
Eclipse UserFriend
Originally posted by: rick_google.NO.SPAMyahoo.com

Is it possible to compile a single java source file without any dependent
files also being compiled?

I have a very large workspace. If I make a change to a class that may
affect other source files, then all other source needs to analyzed and
affected source files compiled. This can take several minutes to complete
in some cases.

One solution seems to be turning of auto-build on resource save, but then
I loss ability to compile that file.

Most errors in a source file are noted by the problem indication feature
of the editor, is this a reliable substitute for compiling?

Thanks,
Rick
Re: Compiling a single java source file [message #111692 is a reply to message #111597] Wed, 29 October 2003 12:07 Go to previous messageGo to next message
Jerome Lanneluc is currently offline Jerome LannelucFriend
Messages: 572
Registered: July 2009
Senior Member
"Rick" <rick_google@NO.SPAMyahoo.com> wrote in message
news:bnn469$l3d$1@eclipse.org...
> Is it possible to compile a single java source file without any dependent
> files also being compiled?

This is not possible.

> I have a very large workspace. If I make a change to a class that may
> affect other source files, then all other source needs to analyzed and
> affected source files compiled. This can take several minutes to complete
> in some cases.
This is not acceptable. You may have found a bug or a performance problem in
the Java builder. Could you please answer the following questions:
- How big is your workspace?
- What kind of change makes it compile dependents deuring several minutes?
- How long does it take to do a full build?
- What version of Eclipse do you use?

> One solution seems to be turning of auto-build on resource save, but then
> I loss ability to compile that file.
>
> Most errors in a source file are noted by the problem indication feature
> of the editor, is this a reliable substitute for compiling?
Yes problems shown in the Java editor are a reliable substitute. In fact the
only difference is that the .class files are not generated, but problem
detection is the same.

Jerome
Re: Compiling a single java source file [message #111733 is a reply to message #111692] Wed, 29 October 2003 17:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rick_google.NO.SPAMyahoo.com

I am using eclipse 2.0.3 within IBM WSAD 5.0

I may have over stated the time to "compile". I think possibly longer time
due to pagefile thrashing, but still takes about 15 seconds under more
ideal conditions. A full rebuild takes 3.25 minutes for about 4,000
classes.

The particular class I was working with contains a class with public
static final Strings used as constants by many classes (found in another
project).

In reality the .class files are not being recreated. The UI is telling me
compiling is going on, but no .class files are being regenerated.

I have found that if I add a method to class that is an implementation of
an interface (but not referenced in other projects), eclipse will
sometimes analyze other projects looking for source to compile. But after
this happens once, it doesn't seem to happen again. After some testing, it
looks like an incremental build will check to see if a build needs to take
place on any open project. So if I rebuild a project, go to and edit
source in a totally unrelated project and an incremental build occurs on
save, then any dependent projects of the project I rebuilt will be checked
to see if any source needs to be rebuilt. Is that an accurate description
of what happens?

IBM has an article that describes various techniques to stop these sorts
of build issues. Seems to me that eclipse should allow the user to control
the build procedure a bit more.

http://www7b.software.ibm.com/wsdd/library/techarticles/0204 _searle/searle.html

Where can I find a detailed description of how eclipse does an incremental
build?

Is there a reason why eclipse doesn't allow a single file compilation?
Seems strange not to include that as a feature.

Thanks,
Rick

Jerome Lanneluc wrote:

> "Rick" <rick_google@NO.SPAMyahoo.com> wrote in message
> news:bnn469$l3d$1@eclipse.org...
> > Is it possible to compile a single java source file without any dependent
> > files also being compiled?

> This is not possible.

> > I have a very large workspace. If I make a change to a class that may
> > affect other source files, then all other source needs to analyzed and
> > affected source files compiled. This can take several minutes to complete
> > in some cases.
> This is not acceptable. You may have found a bug or a performance problem in
> the Java builder. Could you please answer the following questions:
> - How big is your workspace?
> - What kind of change makes it compile dependents deuring several minutes?
> - How long does it take to do a full build?
> - What version of Eclipse do you use?

> > One solution seems to be turning of auto-build on resource save, but then
> > I loss ability to compile that file.
> >
> > Most errors in a source file are noted by the problem indication feature
> > of the editor, is this a reliable substitute for compiling?
> Yes problems shown in the Java editor are a reliable substitute. In fact the
> only difference is that the .class files are not generated, but problem
> detection is the same.

> Jerome
Re: Compiling a single java source file [message #111834 is a reply to message #111733] Thu, 30 October 2003 09:52 Go to previous message
Jerome Lanneluc is currently offline Jerome LannelucFriend
Messages: 572
Registered: July 2009
Senior Member
"Rick" <rick_google@NO.SPAMyahoo.com> wrote in message
news:bnou7l$sio$1@eclipse.org...
> I am using eclipse 2.0.3 within IBM WSAD 5.0
You may want to try WSAD 5.1 (which is based on Eclipse 2.1.1). The
incremental compiler was greatly improved in Eclipse 2.1).

> In reality the .class files are not being recreated. The UI is telling me
> compiling is going on, but no .class files are being regenerated.
..class files are not regenerated if they would produce the same bytecode,
but an analysis is still needed.

> I have found that if I add a method to class that is an implementation of
> an interface (but not referenced in other projects), eclipse will
> sometimes analyze other projects looking for source to compile. But after
> this happens once, it doesn't seem to happen again. After some testing, it
> looks like an incremental build will check to see if a build needs to take
> place on any open project. So if I rebuild a project, go to and edit
> source in a totally unrelated project and an incremental build occurs on
> save, then any dependent projects of the project I rebuilt will be checked
> to see if any source needs to be rebuilt. Is that an accurate description
> of what happens?
Yes

> IBM has an article that describes various techniques to stop these sorts
> of build issues. Seems to me that eclipse should allow the user to control
> the build procedure a bit more.
Please enter a feature request against JDT Core.

> Where can I find a detailed description of how eclipse does an incremental
> build?
Sorry there's none.

> Is there a reason why eclipse doesn't allow a single file compilation?
> Seems strange not to include that as a feature.
I'm not sure if I know all the good reasons, but one could be to avoid
having the NoSuchMethodError exception at runtime because you forgot to
compile all dependents after removing a method.
If you feel that allowing a single file compilation is important, please
fill a feature request.

Jerome
Previous Topic:Unable to assign a color to user defined task tags
Next Topic:List of source folders on build path
Goto Forum:
  


Current Time: Sat Jul 27 16:37:34 GMT 2024

Powered by FUDForum. Page generated in 0.03363 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top