Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How do I bring, integrate, include -- whatever you want to call it -- a Java source file into an exi
How do I bring, integrate, include -- whatever you want to call it -- a Java source file into an exi [message #239472] Thu, 04 January 2007 22:34 Go to next message
Eclipse UserFriend
Originally posted by: kwarner.uneedspeed.net

Ok, here's some thing that should be simple. I have a Java source file -- let's call it Foo.Java -- it defines a class. I want to bring it into my existing project -- lets call it Bar. I put Foo.Java into my source folder (src) and I can edit it. But I can't compile it or cause it to be built when I build my project.

How do I integrate the Java source into my project. I've looked in the Help System and get no help.
Re: How do I bring, integrate, include -- whatever you want to call it -- a Java source file into an [message #239477 is a reply to message #239472] Fri, 05 January 2007 00:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kwarner.uneedspeed.net

Ok, I see how to Import a file. I also see that Save'ing the file causes a compile.

Is there a Compile button somewhere that I'm overlooking? Seems that Save'ing to Compile is a little obtuse. A Compile button/menu item seems more direct.




DemonDuck wrote:
>
> Ok, here's some thing that should be simple. I have a Java source file
> -- let's call it Foo.Java -- it defines a class. I want to bring it
> into my existing project -- lets call it Bar. I put Foo.Java into my
> source folder (src) and I can edit it. But I can't compile it or cause
> it to be built when I build my project.
>
> How do I integrate the Java source into my project. I've looked in the
> Help System and get no help.
Re: How do I bring, integrate, include -- whatever you want to call it -- a Java source file into an [message #239482 is a reply to message #239477] Fri, 05 January 2007 02:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wegener.cboenospam.com

DemonDuck wrote:
> Ok, I see how to Import a file. I also see that Save'ing the file
> causes a compile.
> Is there a Compile button somewhere that I'm overlooking? Seems that
> Save'ing to Compile is a little obtuse. A Compile button/menu item
> seems more direct.
>

The Eclipse Java development tools are designed around an incremental
compiler that makes sure the project is always fully built. The build
process kicks in when whenever a resource (file) is saved. There is no
need for a separate compile button as long as the automatic build option
is turned on.
>
>
>
> DemonDuck wrote:
>>
>> Ok, here's some thing that should be simple. I have a Java source
>> file -- let's call it Foo.Java -- it defines a class. I want to bring
>> it into my existing project -- lets call it Bar. I put Foo.Java into
>> my source folder (src) and I can edit it. But I can't compile it or
>> cause it to be built when I build my project.
>>
>> How do I integrate the Java source into my project. I've looked in
>> the Help System and get no help.
Re: How do I bring, integrate, include -- whatever you want to call it -- a Java source file into an [message #239544 is a reply to message #239482] Fri, 05 January 2007 19:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kwarner.uneedspeed.net

David Wegener wrote:
> DemonDuck wrote:
>
>> Ok, I see how to Import a file. I also see that Save'ing the file
>> causes a compile. Is there a Compile button somewhere that I'm
>> overlooking? Seems that Save'ing to Compile is a little obtuse. A
>> Compile button/menu item seems more direct.
>>
>
> The Eclipse Java development tools are designed around an incremental
> compiler that makes sure the project is always fully built. The build
> process kicks in when whenever a resource (file) is saved. There is no
> need for a separate compile button as long as the automatic build option
> is turned on.
>
>>

Ok... but, "...there is no need for a separate compile button..." With all the fine grained feature sets in Eclipse -- there's no compile this file button????

Ok... who am I to argue...
Re: How do I bring, integrate, include -- whatever you want to call it -- a Java source file into an [message #239546 is a reply to message #239544] Sat, 06 January 2007 01:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wegener.cboenospam.com

DemonDuck wrote:
> David Wegener wrote:
>> DemonDuck wrote:
>>
>>> Ok, I see how to Import a file. I also see that Save'ing the file
>>> causes a compile. Is there a Compile button somewhere that I'm
>>> overlooking? Seems that Save'ing to Compile is a little obtuse. A
>>> Compile button/menu item seems more direct.
>>>
>>
>> The Eclipse Java development tools are designed around an incremental
>> compiler that makes sure the project is always fully built. The build
>> process kicks in when whenever a resource (file) is saved. There is
>> no need for a separate compile button as long as the automatic build
>> option is turned on.
>>
>>>
>
> Ok... but, "...there is no need for a separate compile button..." With
> all the fine grained feature sets in Eclipse -- there's no compile this
> file button????
>
> Ok... who am I to argue...
With automatic build turned on, all files that need to be are compiled
every time you save a file. All files are up to date. Hitting a
compile this file button would be a waste of time.

If you turn off automatic build, a Build All button is added to the tool
bar. You can also use Project->Build All to build the project in this mode.
Re: How do I bring, integrate, include -- whatever you want to call it -- a Java source file into an [message #239554 is a reply to message #239546] Sat, 06 January 2007 18:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kwarner.uneedspeed.net

David Wegener wrote:
>
>> Ok... but, "...there is no need for a separate compile button..."
>> With all the fine grained feature sets in Eclipse -- there's no
>> compile this file button????
>>
>> Ok... who am I to argue...
>
> With automatic build turned on, all files that need to be are compiled
> every time you save a file. All files are up to date. Hitting a
> compile this file button would be a waste of time.
>
> If you turn off automatic build, a Build All button is added to the tool
> bar. You can also use Project->Build All to build the project in this
> mode.

Oh... Thanks... That's good to know.

I've had to work on Java code that had circular dependencies in it. I know -- hard to believe that a Java project could have circular dependencies but it happened to me. A whole bunch of really bright programmers worked really hard to put together a large program with circular dependencies -- it should be in some kind of record book.

The only way I got it untangled was to compile one file at a time using the class files from the previous versions of the other class files so everything was not up to date at the same time. The app wouldn't have run but it could be compiled....

This is why I think a "compile this file" button is a good capability to have.
Re: How do I bring, integrate, include -- whatever you want to call it -- a Java source file into an [message #239945 is a reply to message #239554] Sat, 20 January 2007 23:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: thunderaxiom.gmail.com

DemonDuck skrev den 06-01-2007 19:56:

> I've had to work on Java code that had circular dependencies in it. I
> know -- hard to believe that a Java project could have circular
> dependencies but it happened to me. A whole bunch of really bright
> programmers worked really hard to put together a large program with
> circular dependencies -- it should be in some kind of record book.
>
> The only way I got it untangled was to compile one file at a time using
> the class files from the previous versions of the other class files so
> everything was not up to date at the same time. The app wouldn't have
> run but it could be compiled....
> This is why I think a "compile this file" button is a good capability to
> have.

I inherited such a project. It turned out that some refactoring got rid
of the circular dependency.

You will most likely want to create a new project in your workspace for
the code that needs to be compiled first.

--
Thorbjørn
Re: How do I bring, integrate, include -- whatever you want to call it -- a Java source file into an [message #239954 is a reply to message #239945] Sun, 21 January 2007 00:43 Go to previous message
Eclipse UserFriend
Originally posted by: kwarner.uneedspeed.net

Thorbjørn Andersen wrote:
> DemonDuck skrev den 06-01-2007 19:56:
>
>> I've had to work on Java code that had circular dependencies in it. I
>> know -- hard to believe that a Java project could have circular
>> dependencies but it happened to me. A whole bunch of really bright
>> programmers worked really hard to put together a large program with
>> circular dependencies -- it should be in some kind of record book.
>>
>> The only way I got it untangled was to compile one file at a time
>> using the class files from the previous versions of the other class
>> files so everything was not up to date at the same time. The app
>> wouldn't have run but it could be compiled....
>> This is why I think a "compile this file" button is a good capability
>> to have.
>
>
> I inherited such a project. It turned out that some refactoring got rid
> of the circular dependency.
>
> You will most likely want to create a new project in your workspace for
> the code that needs to be compiled first.
>

Thankfully, that project I mentioned is history.

There's always a workaround but it would be nice simple addition to Eclipse to have a "Compile This File" button. But maybe Java can't just compile one file and leave unresolved links. Might need compiler mods to do that. Didn't think about that until now.
Previous Topic:No .class files - desperate
Next Topic:Automatically sign JARs?
Goto Forum:
  


Current Time: Thu Mar 28 10:43:24 GMT 2024

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

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

Back to the top