Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Java Build Path Projects
Java Build Path Projects [message #79234] Tue, 21 June 2005 01:39 Go to next message
Ben Sisson is currently offline Ben SissonFriend
Messages: 202
Registered: July 2009
Senior Member
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
Re: Java Build Path Projects [message #79276 is a reply to message #79234] Tue, 21 June 2005 02:01 Go to previous messageGo to next message
Eclipse UserFriend
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 #79319 is a reply to message #79276] Tue, 21 June 2005 13:10 Go to previous messageGo to next message
Ben Sisson is currently offline Ben SissonFriend
Messages: 202
Registered: July 2009
Senior Member
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
Re: Java Build Path Projects [message #79334 is a reply to message #79319] Tue, 21 June 2005 13:19 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #81448 is a reply to message #79523] Tue, 28 June 2005 14:58 Go to previous messageGo to next message
Ben Sisson is currently offline Ben SissonFriend
Messages: 202
Registered: July 2009
Senior Member
I did this exactly as described. I selected the projects and ran my
project. I get the same error this way as I did trying the other way. I
get a class not found exception.

The source does not show any errors, I only receive this error when I run
the process.

Any other suggestions, I would appreciate them.

Thanks,
Ben
Re: Java Build Path Projects [message #81595 is a reply to message #79334] Tue, 28 June 2005 20:07 Go to previous messageGo to next message
Ben Sisson is currently offline Ben SissonFriend
Messages: 202
Registered: July 2009
Senior Member
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)?

Thanks,
Ben
Re: Java Build Path Projects [message #81625 is a reply to message #81595] Tue, 28 June 2005 20:36 Go to previous messageGo to next message
Ben Sisson is currently offline Ben SissonFriend
Messages: 202
Registered: July 2009
Senior Member
In addition, I have tried the following and still get the same error.

I right clicked on the new project, the one that I want to reference an
older project, and then selected Properties->Java Build Path->Order and
Export (tab)

At the tab I selected my current project and the older project that I want
to be able to access. I then moved my current project beneath the older
project. However, this did not fix my problem. When I run the new
project and it trys to create a class from the older project I still get
the Class not found error.

Any help would be greatly appreciated. This seems like it should be so
easy.

Thanks,
Ben
Re: Java Build Path Projects [message #81638 is a reply to message #81595] Tue, 28 June 2005 23:04 Go to previous messageGo to next message
Eclipse UserFriend
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
>
Re: Java Build Path Projects [message #82581 is a reply to message #81638] Fri, 01 July 2005 18:03 Go to previous message
Ben Sisson is currently offline Ben SissonFriend
Messages: 202
Registered: July 2009
Senior Member
Thanks, that solved the problem.

Ben
Previous Topic:Update Manager Connection Fails
Next Topic:CPL License Clarification
Goto Forum:
  


Current Time: Thu Jan 02 21:07:32 GMT 2025

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

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

Back to the top