Help with importing a class [message #249968] |
Sat, 23 February 2008 10:04  |
Eclipse User |
|
|
|
Originally posted by: realmenlikemath.gmail.com
I'm trying to write a java program, and I've got this class file that has
a bunch of methods in it I want to use. I tried dragging and dropping it
into the src file of my project. I tried it the bin and the src, but when
I write my main method, it's still not recognizing the methods from the
other class. I'm new to Eclipse, and new to Java, so excuse me if this
question is ridiculous. Any help would be greatly appreciated.
Thanks,
Jon
|
|
|
|
|
Re: Help with importing a class [message #250046 is a reply to message #249980] |
Sun, 24 February 2008 16:28  |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
David Wegener wrote:
> Jon Beardsley wrote:
>> I'm trying to write a java program, and I've got this class file that
>> has a bunch of methods in it I want to use. I tried dragging and
>> dropping it into the src file of my project. I tried it the bin and
>> the src, but when I write my main method, it's still not recognizing
>> the methods from the other class. I'm new to Eclipse, and new to
>> Java, so excuse me if this question is ridiculous. Any help would be
>> greatly appreciated. Thanks,
>> Jon
>>
> You need to define a Class Folder on the Java Build Path->Libraries tab.
> Make sure that the folder has the correct package hierarchy for the
> class that you are trying to use and put the class file in the folder at
> the appropriate level.
>
> The Class Folder is added to the build class path for the project so the
> class will now be available.
>
> Note that content assist will only be able to provide method names. You
> won't be able to see any JavaDoc unless you attach source to the Class
> Folder.
>
In addition to that good advice, you should invest a couple of hours in
going through the tutorials that come with Eclipse. They will hlep you
understand how ti works and how best to use it.
Open the Help > Contents and then browse the Workbench User Guide and
Java Development User Guide chapters; find the "Getting Started"
sections and there you'll see the tutorials.
One of the tutorials deals specifically with how to organize projects in
Eclipse, which would have helped you get past the problem above.
Hope this helps,
Eric
|
|
|
Powered by
FUDForum. Page generated in 0.07853 seconds