|
Re: Java Build Path Projects [message #79276 is a reply to message #79234] |
Tue, 21 June 2005 02:01 |
Eclipse User |
|
|
|
Originally posted by: plankton.softwitch.net
Ben wrote:
> I created a project that has specific file processing capabilities. I
> created another project that needed to use those same capabilities. I
> right clicked on the project, selected properties->Java Build Path and
> then the Projects tab. I then added the project that has the
> capabilities that my new project needs.
> However, my new project does not seem to recognize the methods from the
> existing project. I then added a import statement with the package
> name the methods that I need from the first project. As I entered the
> package name it seemed to recognize the source of the package. It did
> not recieve an error message and provided the final part of the package
> name as I typed it. However, when I tried to create a new instance it
> the class from the package it still did not recognize it.
>
> Everything seems to be setup correctly. Can someone please provide me
> with a suggestion.
>
> Thanks,
> Ben
>
1. At first open project property.
2. Choose "Project References" and check projects which you want to
reference
3. Choose Java Build Path and click Libraries tab
4. click "Add Class Folder" button and Choose class folders contained by
project will be referenced.
jiyul
|
|
|
|
Re: Java Build Path Projects [message #79334 is a reply to message #79319] |
Tue, 21 June 2005 13:19 |
Eclipse User |
|
|
|
Originally posted by: wegener.cboenospam.com
Ben wrote:
> jiyul,
> Thanks for your help. However, this just creates a new problem. It
> elimenates any source code errors that I was getting from the missing
> class. However when I run the code, it fails when it trys to instantiate
> a new instance of the class. It gets an error "ClassNotFoundException".
> However, if I take the same class files from the old project and copy them
> into my new project I no longer get this error. The code works perfectly
> fine without any alterations. Of course, I would prefer not to have to
> copy the code since it would require maintenace of two separate copies of
> the same code. So, I looking for any help that I can get. Below is a
> copy of the line of code that fails:
> FileProcessing fp = new FileProcessing();
> Again, this works perfectly fine if I copy the class files from the old
> project but if I try to reference the old project I get an error.
> Thanks for any help that you can provide,
> Ben
You have the other project on the Build Path. You need to get it on the
Run Path. Open up the launch configuration and go to the Classpath tab.
The other project needs to be included
|
|
|
Re: Java Build Path Projects [message #79467 is a reply to message #79334] |
Wed, 22 June 2005 00:28 |
Eclipse User |
|
|
|
Originally posted by: plankton.softwitch.net
David Wegener wrote:
> Ben wrote:
>
>> jiyul,
>
>
>> Thanks for your help. However, this just creates a new problem. It
>> elimenates any source code errors that I was getting from the missing
>> class. However when I run the code, it fails when it trys to
>> instantiate a new instance of the class. It gets an error
>> "ClassNotFoundException". However, if I take the same class files
>> from the old project and copy them into my new project I no longer get
>> this error. The code works perfectly fine without any alterations.
>> Of course, I would prefer not to have to copy the code since it would
>> require maintenace of two separate copies of the same code. So, I
>> looking for any help that I can get. Below is a copy of the line of
>> code that fails:
>
>
>> FileProcessing fp = new FileProcessing();
>
>
>> Again, this works perfectly fine if I copy the class files from the
>> old project but if I try to reference the old project I get an error.
>
>
>> Thanks for any help that you can provide,
>> Ben
>
>
> You have the other project on the Build Path. You need to get it on the
> Run Path. Open up the launch configuration and go to the Classpath
> tab. The other project needs to be included
>
Yeah, I'll be work. Sorry, I missed.
|
|
|
Re: Java Build Path Projects [message #79523 is a reply to message #79276] |
Wed, 22 June 2005 05:45 |
Eclipse User |
|
|
|
Originally posted by: eclipse.rizzoweb.com
jiyul wrote:
> 1. At first open project property.
> 2. Choose "Project References" and check projects which you want to
> reference
> 3. Choose Java Build Path and click Libraries tab
> 4. click "Add Class Folder" button and Choose class folders contained by
> project will be referenced.
This is actually not the best way to set up compilation dependencies.
All you have to do is open the second project (the one that depends on
the first one), choose Properties > Java build path > Projects tab and
then select the first project. There is no need to add it to the Project
References, and definitely don't manually include another Project's
class output folder on the Libraries tab of another Project - that is
just plain silly when the Projects tab is there for that exact purpose.
HTH,
Eric
|
|
|
|
|
|
Re: Java Build Path Projects [message #81638 is a reply to message #81595] |
Tue, 28 June 2005 23:04 |
Eclipse User |
|
|
|
Originally posted by: wegener.cboenospam.com
Ben wrote:
> You have the other project on the Build Path. You need to get it on the
> Run Path. Open up the launch configuration and go to the Classpath
> tab. The other project needs to be included
>
>
> Could you please clearify what you said. I believe this is my issue but
> am not sure that I understand. When you refer to "other project", which
> project are you talking about?
>
> What do I need to get on the "Run Path"?
>
> Is the "launch configurgation" part of the new projects properties
> (right click on new project)?
The launch configuration can be found on the Run... dialog. Open it up
off of the Run menu. Look for Run... 2/3 of the way down. Select the
launch configuration for your main class. Go to the Classpath tab. You
can use the Project to select the other project to be added. You might
also try the Restore Default Entries button. By default, any referenced
project should be included in the default launch configuration.
>
> Thanks,
> Ben
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.08085 seconds